April 4th, 2010, 05:11 PM
I need a little input help.
I'm writing a small program for a class I am working on and I have a bit of code that is not functioning correctly. I've tried debugging but it isn't helping much.
The problem is in the function note1out(). The program completely skips over the getline command and doesn't wait for input from the user. As far as I can tell it should work fine but it doesn't. Can someone please analyze this little snippit and help me find out the problem. Let me know if you need more of the code.
P.S. The compiler is Dev C++.
ifstream note1 ("note1.txt");
while (!note1.eof() )
getline (note1, a);
cout << "The note reads: " << endl << a << endl << endl;
cout << "Begin re-writing the note... " << endl;
getline (cin, a);
ofstream note1 ("note1.txt");
note1 << a;
cout << "The note has been saved..." << endl;
Last edited by Vipervenom9; April 4th, 2010 at 05:15 PM.
Reason: Need code to be in code window.
Tags for this Thread
Click Here to Expand Forum to Full Width