fstream

When im using ifstream and ofstream to read/load text files, for exampel
1
2
3
ifstream text1(load); 
char ch[Size];
text1.get(ch, Size);


Im only getting the first line in the text file, if the content would look like this:
hello
to
you

My program would only read hello to ch.

Whats the problem ?
get only works on 1 line.

Extracts characters from the stream and stores them as a c-string into the array beginning at s. Characters are extracted until either (n - 1) characters have been extracted or the delimiting character '\n' is found.


http://www.cplusplus.com/reference/iostream/istream/get.html
Last edited on
Topic archived. No new replies allowed.