为什么这段代码不工作?该错误消息:main.cpp中:147:5:错误:预期 ';' 前 '鳍'C++字符串连接解决方案
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;
}
哪一个是147行?好像有很多你没有显示的代码 – 2013-03-24 00:30:31
错误说明了这一切:你在第146行忘了';'(因为错误在第147行)。咩。 – syam 2013-03-24 00:31:35
错误消息实际上告诉你**完全**错误是什么。 – 2013-03-24 00:31:43