00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "TStack2.h"
00013 #include "require.h"
00014 #include <iostream>
00015 #include <fstream>
00016 #include <string>
00017 using namespace std;
00018
00019 int main() {
00020 ifstream file("TStack2Test.cpp");
00021 assure(file, "TStack2Test.cpp");
00022 Stack<string> textlines;
00023
00024 string line;
00025 while(getline(file, line))
00026 textlines.push(new string(line));
00027 int i = 0;
00028
00029 Stack<string>::iterator it = textlines.begin();
00030 Stack<string>::iterator* it2 = 0;
00031 while(it != textlines.end()) {
00032 cout << it->c_str() << endl;
00033 it++;
00034 if(++i == 10)
00035
00036
00037 it2 = new Stack<string>::iterator(it);
00038 }
00039
00040 delete it2;
00041 }