Hello,
I'm working on a hangman program, and I'm having trouble writing a code that chooses a random everytime it is played...
Here's the code I started on...
Thanks for the help.Code:string s; int count=0; string filename = "words.txt"; ifstream input; input.open(filename.c_str()); if (input.fail()) { cout << "could not open " << filename << " for reading" << endl; exit(1); } while (getline(input, s)) { count++; }