阅读背景:

如何使用ifstream逐行解析

来源:互联网 

If I wanted to parse from a file line-by-line and store the data in separate variables, using getline to store into a string and parse/convert to separate variables seems like a long way to do it. For example, for line "ABC a1 1 2 3", if I wanted to store the first two data into strings and the rest of the three into integers, what would be an efficient way to read from the file line-by-line and store it accordingly? If I wanted to parse from a file line-by-line a




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: