开发者

How to read uptill a particular character in a file, without going through the file, character by character?

Want to detect the '\n' witho开发者_运维问答ut going through each and every character of a text file. Any hints?


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.


How about getline(...) from Iostream?

http://www.cplusplus.com/reference/iostream/istream/getline/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜