> On Tue, 09 Aug 2011 11:26:29 +0000, Juha Nieminen wrote:
> I think the std::getline() with a null line terminator is a much
> simpler and better solution.
Stroustrup, section 20.3.15, page 598
The getline() function reads a line terminated by eol into its
string, expanding the string as needed to hold the line. If no eol
argument is provided, a newline '\n' is used as the delimiter. The line
terminator is removed from the stream but not entered into string.
where string = 2nd argument, eol = 3rd argument
now my point is when you give '\0' (its called null or NULL ?) as 3rd
argument which is not present in the input stream, what will be its
behavior ?
(1) will getline() keep on looking for it till its reaches EOF (End of
File) and read whole file into the string
(2) If I give anything which is not present in the input e.g. '#' will it
behave the same ?
--
-- arnuld
www.LispMachine.Wordpress.com