64,637
社区成员
发帖
与我相关
我的任务
分享
#include <tchar.h>
const char* ch=_T("D:\\测试\\1.txt");
#include <iostream>
#include <fstream>
#include <tchar.h>
using namespace std;
int main()
{
const char* ch=_T("d:\\文档.txt");//此文件必须存在,否则失败
ifstream fin;
//open( const char* szName, int nMode = ios::in, int nProt = filebuf::openprot );
fin.open(ch);
if(!fin)
cout<<"read error"<<endl;
return 0;
}
#include <iostream>
#include <fstream>
#include <tchar.h>
using namespace std;
int main()
{
const char* ch=_T("d:\\文档.txt");//此文件必须存在,否则失败
//ifstream( const char* szName, int nMode = ios::in, int nProt = filebuf::openprot );
ifstream fin(ch);
if(!fin)
cout<<"read error"<<endl;
return 0;
}