{
string line;
fstream File;
File.open("caps.txt");
cout << "Please enter a priming word." << endl;
cin >> line; //a priming read,use these with files as conditions for while loops, or a do while
while(File.peek() != EOF) //the peek is so we are not actually at EOF, rather we can append words at this location
{
cin >> line;
}
cout << "Please enter the first word and hit enter." << endl;
File << endl; //start a new line in the output file to put word on
cin >> line; //get priming read
while (line != "end")
{
File << line << endl;
cout << "Please enter another word to add to the dictionary file, enter end to exit" << endl;
cin >> line; //get more words, or the "end"
}
cout << endl;
File.close(); //changed from close();
}
Notorion came up with this one, which I both appreciated and really liked for its simplicity, but still no dice. This thing has to be finished by Sunday night, so it's crunch time.

New Topic/Question
Reply




MultiQuote




|