help needed with file I/O

This is a discussion on help needed with file I/O within the C++ Programming forums, part of the General Programming Boards category; I am not yet sure why the next line is not being read ...because of your while conditional: Code: while ...

  1. #16
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    I am not yet sure why the next line is not being read
    ...because of your while conditional:
    Code:
    while (!getline (myfile,line))
    That says continue looping as long as the read fails. Since your read is a success, the loop terminates.

  2. #17
    Registered User
    Join Date
    Sep 2005
    Posts
    14
    That did it... I dunno what i was thinking.. thanks a lot to everybody...

  3. #18
    Registered User
    Join Date
    Jan 2005
    Posts
    7,340
    I did not notice that when I suggested you use it earlier. Sorry about that.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File I/O Assertion Failure in VS2008
    By clegs in forum C Programming
    Replies: 5
    Last Post: 12-25-2008, 03:47 AM
  2. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 10:51 PM
  3. 2 questions surrounding an I/O file
    By Guti14 in forum C Programming
    Replies: 2
    Last Post: 08-30-2004, 11:21 PM
  4. advice on file i/o
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 11-29-2001, 04:56 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21