Hi all,
I was wondering if, when reading from a file, there is a way (or an algorithm) to check if you reached the end of a line.
Thanks.
Hi all,
I was wondering if, when reading from a file, there is a way (or an algorithm) to check if you reached the end of a line.
Thanks.
Sorry I thought you said end of file. -ashamed- You'd probably get a '\n' character at the end of a line. Just use the getline() function and that will read in a whole line.
Last edited by jmd15; 08-27-2006 at 03:52 PM.
Trinity: "Neo... nobody has ever done this before."
Neo: "That's why it's going to work."
c9915ec6c1f3b876ddf38514adbb94f0
I thought eof() was the end-of-file condition. I need something to check if you reached the end of a line.
use
That will read until a newline character is presentedCode:getline( cin, string_var, '\n' );
Thanks. I'll let you know how it works.