开发者

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

开发者 https://www.devze.com 2023-03-10 08:53 出处:网络
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.

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

精彩评论

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