00034 {
00035 requireArgs(argc, 1);
00036 ifstream in(argv[1]);
00037 assure(in, argv[1]);
00038 Stack<Object> textlines;
00039 string line;
00040
00041 while(getline(in, line))
00042 textlines.push(new MyString(line));
00043
00044 MyString* s;
00045 for(int i = 0; i < 10; i++) {
00046 if((s=(MyString*)textlines.pop())==0) break;
00047 cout << *s << endl;
00048 delete s;
00049 }
00050 cout << "Letting the destructor do the rest:"
00051 << endl;
00052 system("pause");
00053 }