64,281
社区成员
发帖
与我相关
我的任务
分享
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
void main()
{
ifstream in;
in.open("C:\Useres\dell\Documents\Visual Studio 2010\Projects\p254 2\abc.txt");
string s;
in>>s;
cout<<s;
system("pause");
}
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
void main()
{
ifstream in;
in.open("C:\\Useres\\dell\\Documents\\Visual Studio 2010\\Projects\\p254 2\\abc.txt");
string s;
in>>s;
cout<<s;
system("pause");
}
if (in.fail())
{
cout << "open file fail" << endl;
}