用vs2012读取文本文件后cmd黑框闪退?
vs2012吧
全部回复
仅看楼主
level 1
孤狼526 楼主
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
ifstream in;
string filename;
//getline(cin,filename,'\n');
//cin>>filename;
in.open("E:\\chtb_0001.nw");
if(!in)
{
cout<<"打开文件出错!"<<endl;
return 1;
}
char ch;
while(!in.eof())
{
in.read(&ch, 1);
cout<<ch;
}
in.close();
}
2015年01月09日 02点01分 1
level 1
孤狼526 楼主
在vc++6.0里面正常
2015年01月09日 02点01分 2
level 9
。。。。。。。。。。。。。。。。。。。。。。。。。。。。
system("pause")
2015年01月12日 05点01分 3
1