Search:
Forum
General C++ Programming
fstream
fstream
Jul 2, 2008 at 10:21pm UTC
nilsson
(3)
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 ?
Jul 2, 2008 at 10:27pm UTC
Zaita
(2770)
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
Jul 2, 2008 at 10:29pm UTC
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs