Menu

!cin.eof()

2002-12-01
2012-09-26
  • Nobody/Anonymous

    Hello, I have a little problem again. If I am using the unformatted input with the code:

    string s;
    while(!cin.eof())
    {
    getline(cin, s);
    }

    When the signal eof will be reached? Or how can I reach that signal, so the loop will stop? The whole program is a little bit longer, but misunderstanding for me is only on this line. Franjo

     
    • Nobody/Anonymous

      Going back to my textbook, cuz I have trouble keeping this straight, the DOS end of file condition can be simulated by pressing control-z and enter.  (In UNIX its cntrl-d)

      Wayne

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.