CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Nov 2008

    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++.

    int note1in()
    string a;

    ifstream note1 ("note1.txt");
    while (!note1.eof() )
    getline (note1, a);
    cout << "The note reads: " << endl << a << endl << endl;


    int note1out()
    string a;
    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 04:15 PM. Reason: Need code to be in code window.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.