Reputation: 22946
Want to detect the '\n' without going through each and every character of a text file. Any hints?
Upvotes: 2
Views: 124
Reputation: 1904
How about getline(...)
from Iostream?
http://www.cplusplus.com/reference/iostream/istream/getline/
Upvotes: 3
Reputation: 206879
Something has to read all the bytes to check for that delimiter.
Use one of the getline
(or istream::getline) functions so that the library does the searching, not your code.
Upvotes: 3