为什么这段代码不起作用?错误消息:main.cpp:147:5: error: expected ';' 在'fin'之前</p>
string file;
ifstream fin;
fin.clear();
cout << "\n\t--------------------------------Enter Person's name then surname to display------";
cin>>file;
file +=".txt"
fin.open(file.c_str());
char word[50];
fin>>word;
while(fin.good()){
cout << word << " ";
fin >> word;
}
system("pause");
return 0;
}