c++中文件操作,获取文件内容时出错
[code=c]ifstream get_fi("D:\\20130701_2013070302.txt", ios::binary);
while (EOF != get_fi.peek())
{
get_fi.get(APPID, 127, ','); //从文件从获取字符到字符数组APPID中,当遇到','时或读取了127个字符时终止
get_fi.seekg(1, ios::cur);
get_fi.get(AppVersion, 127, ',');
get_fi.get(ProductFunction, 127, ',');
get_fi.get(OptionTime, 127, ',');
get_fi.get(IP, 127, ',');
get_fi.get(OptionTimes, 127, ',');
get_fi.get(SessionId, 127, ',');
get_fi.get(FunctionLabel, 127, ',');[/code]
fgetc() ; 获取行信息
strtok(); 通过“,”分割字符串
两个函数的参数,已经原因楼主可以查查资料