int main  ) 
 

Definicja w linii 19 pliku TStack2Test.cpp.

Odwołuje się do assure(), Stack< T >::begin(), Stack< T >::end(), Stack< T >::iterator i Stack< T >::push().

00019            {
00020   ifstream file("TStack2Test.cpp");
00021   assure(file, "TStack2Test.cpp");
00022   Stack<string> textlines;
00023   // Read file and store lines in the Stack:
00024   string line;
00025   while(getline(file, line))
00026     textlines.push(new string(line));
00027   int i = 0;
00028   // Use iterator to print lines from the list:
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) // Remember 10th line
00035     /*Dziesiąty wiersz pliku jest zapamiętywany dzięki wygenerowaniu za pomocą konstruktora
00036     kopiującego drugiego iteratora, utworzonego na podstawie pierwszego*/
00037       it2 = new Stack<string>::iterator(it);
00038   }
00039   //cout << (*it2)->c_str() << endl; //jakis wyciek pamieci, cos nie tak :(
00040   delete it2;
00041 } 


Wygenerowano Tue Jun 27 19:36:52 2006 dla DL programowanie, zadania 12 z rozdzialu 16 ksiazki Thinking in C++ programem  doxygen 1.4.6-NO