#include #include #include using namespace std; int main() { ifstream fin; fin.open("/home/www/text/buchan/thirtyninesteps"); if (fin.fail()) { cout << "Couldn't open the file\n"; exit(1); } const int array_size = 100000; string story[array_size]; int length = 0; while (true) { string word; fin >> word; if (fin.fail()) break; if (length >= array_size) { cout << "Array size exceeded\n"; exit(1); } story[length] = word; length += 1; } cout << length << " words read into the array\n"; fin.close(); }