// ========================================================================== // Implementation for a string array with random selection // A. Fischer, June 4, Nov 14, 2000 file: rstrings.cpp #include "tools.hpp" #include "rstrings.hpp" // ========================================================================== RandString::RandString( istream& vocin, int sz ) { //cerr << "\nConstructing RandString "; data = new const char*[sz]; for (int k=0; k> ws; vocin.getline( line, 80 ); if (!vocin.good()) break; put(line, vocin.gcount()); // store the string } //cerr << "\nRead " <= maxData) fatal("Sorry, vocabulary too large"); data[n++] = store.put(s, len); // Add to SStore & FlexArray. } // ------------------------------------------------------------------------- void RandString::print( ostream& outs ) const { outs << "The vocabulary: \n"; for (int k=0; k