home *** CD-ROM | disk | FTP | other *** search
- #include "gcstring.hpp"
- #include <time.h>
-
- main(int argc, char ** argv)
- {
- if(argc != 2)
- {
- cout << "Usage: " << argv[0] << " filename";
- exit(-1);
- }
- cout << farcoreleft() << "\n";
- gcstring::Initialize();
- gcstring s;
- #ifdef __ZTC__
- filebuf fb;
- fb.open(argv[1], input);
- istream from(&fb);
- #else ifdef __TURBOC__
- ifstream from(argv[1]);
- #endif
- if(!from.good())
- {
- cout << "Cannot find, open or use file " << argv[1];
- exit(-2);
- }
- time_t t1 = time(NULL);
- while(from.good())
- {
- gcstring s1, s2;
- from >> s1;
- from >> s2;
- s = s1 + gcstring(" ") + s2 + gcstring("EOS");
- cout << s << "\n";
- }
- time_t t2 = time(NULL);
- cout << farcoreleft();
- cout << "\nElapsed time is " << t2 - t1 << " sec";
- }
-
-