VS2013 处理文件 逐行读取test.log ,文档还没有结束 却跳出了循环
在VS2013 处理文件 ,如下代码,却出现文档还没有结束 却跳出了循环 ,原文档200行,只读了120行就结束了,
显示结束行如

在notepad++下查看的文档,怎么是这种符号?同时在右下角,显示文档是UNIX ANSI 的状态
ifstream readfile("test.log"); //1----读入文件mail2.log
if (!readfile) //打开文件失败!
{
cout << "Fail to open file in the first 1---!" << endl;
return 1;
}
else
{
int line = 0;
cout << readfile.peek() << endl;
if (!readfile.eof())
{
while (getline(readfile, strLine))//while (getline(readfile, strLine))
{ //判断空行,1-27,修改,空行不处理
if (strLine.size() != 0)
{
line = line + 1;
//cout << "this is the line number" << line << endl;
}
}
cout << strLine << endl;
}
}显示结束行如

在notepad++下查看的文档,怎么是这种符号?同时在右下角,显示文档是UNIX ANSI 的状态
...全文
相关推荐
test_string型转换成对应的float类型_float_读取txt文档_C++/C_vs2017_
在VS2017环境中编译通过,代码读取指定位置的.txt文档,使用文件流的形式读取,将文档里面全部是数字的string类型数据转换成对应的float类型的数据存储到指定的数组。
Log4cxx 使用文档
Log4cxx 使用编译,在2010 出现的错误解决方案。
log4cplus文档
apache公司的log4的c++版本,可以用于用c++开发nginx和apache服务时记录日志。
function-return-vs-console-log
## Return vs Console.log 此仓库包含一个文件,该文件演示了在javaScript函数中使用return和console.log之间的区别。
c++单元测试 log4
作为C++的单元测试,拥有头文件以及cpp文件源码,通过vs编译后,将可以直接使用,使用方法,百度吧。


