Computing.Net > Forums > Programming > Reading from input

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Reading from input

Reply to Message Icon

Name: CommonChild
Date: April 9, 2002 at 12:28:18 Pacific
Comment:

How do I get my input stream to read from the next line of input when reading from a ".dat" file. I'm using the "getline" function to do my extraction, but how do I get it to read to the next line?



Sponsored Link
Ads by Google

Response Number 1
Name: Eric
Date: April 9, 2002 at 12:50:15 Pacific
Reply:

One way is to extract enough chars with each getline call to be sure that a whole line has been extracted. If you try to get more characters than there is in a line, getline will stop at the '\n' char anyway. The next time you use getline it will read from the next line.


0

Response Number 2
Name: CommonChild
Date: April 9, 2002 at 12:58:25 Pacific
Reply:

ok
Thanks a lot
I know it was simple, remedial question
I figured it out after I sent the message out...lol
Go figure
Thanks again, however.


0

Response Number 3
Name: Eric
Date: April 9, 2002 at 12:59:48 Pacific
Reply:

No problem! :-)


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


VBA Problem VB sucks when compared wi...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Reading from input

Reading from a text file in C++ www.computing.net/answers/programming/reading-from-a-text-file-in-c/8983.html

Reading from a USB Barcode-Reader o www.computing.net/answers/programming/reading-from-a-usb-barcodereader-o/11231.html

read from user within loop www.computing.net/answers/programming/read-from-user-within-loop/18778.html