ファイルから各単語を読み取りたい。ファイルを開きますが、while ループには入りません
string x;
ifstream inFile ("test.txt");
if (!inFile) {
cout << "Unable to open file";
exit(1); // terminate with error
}
while (inFile >> x) {
cout << "hi" << endl;
}
cout << "hsiwsdsc" << endl;
inFile.close();