#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main () {
string line;
ifstream myfile("hey.txt");
myfile >> line;
cout << line;
system("pause");
return 0;
}
Run Code Online (Sandbox Code Playgroud)
为什么这不打印出我的“hey.txt”文件中的内容?