int main()
{
ifstream infile;
string arr[ CAP ]; // CAPACITY is 500
int count=0; // how many strings stored in array so far
// TRY TO OPEN THE INPUT FILE "words.txt"
infile.open("words.txt", ios::in);
if ( infile.fail() )
{
cout << "Can't find words.txt. Are you sure it's in this directory? (do a dir command).\nDoes it accidentally have a .txt.txt extension?\n";
exit(0);
}
cout << count << " words stored into array from words.txt\n" ;
cout << "Now printing each word on its own line with line numbers:\n";
// Y O U C H A N G E T H E C O D E I N T H E L O O P B O D Y S O T H A T
// E A C H W O R D I S P R I N T E D O N I T S O W N L I N E
// W I T H L I N E N U M B E R S
for ( int i=0 ; i< count ; i++ )
{
// YOUR CODE HERE do not change anyting else in this starter file
}