/////// File: tstTLnOS.C /////// #include #include #include #include "TLine_OS.h" int main(int argc, String argv[]) { if (argc > 3) { cerr << "Usage: " << argv[0] << " [ key ] file\n"; exit(1); } int keypos=0; if (argc == 3) { keypos=atoi(argv[1]); argv[1] = argv[2]; } ifstream myin(argv[1]); if ( ! myin ) cerr << "Can not open file " << argv[1]; TextLine_OS txtobj(keypos); txtobj.input(myin); txtobj.display(cout); cout << "Input search key:"; char key[16]; cin.getline(key, 16); int i = txtobj.index(key); cout << "index for " << key << " is " << i << endl; return(0); }