#include<iostream>
#include<fstream>
using namespace std;
int main()
{
ifstream datafile("point.txt");
;
char a[81];
if (!datafile)
{
cout << "文件打开失败\n";
}
else
while (!datafile.eof())
{
datafile >>a;
if (datafile.fail())
break;
cout << a << "\n";
}
datafile.close();
return 0;
}
我这里读取没问题啊,是不是你没有创建该文件。