我在60行的作业中遇到了题为“问题”的问题。请大家尽快帮帮我。
59 void storeFile();
60 {
61 cout<< "All the data members are stored in file." << endl;
62
63 ofstream outFile;
64 const char *outputFileName = ("record.txt");
65 outFile.open(outputFileName, ios::out);
66
67 if(!outFile)
68 {
69 cout<< "\nUnable to open the file." << outputFileName << endl;
70 }
71
72 else
73 {
74 outFile VUID; endl;
75 outFile campusID; endl;
76 outFile studentName; endl;
77 outFile fatherName; endl;
78 }
79 };错误:在第60行的'{‘标记c++之前需要未限定的id
发布于 2013-06-26 15:42:43
删除第59行末尾的;。
顺便说一句,正如ChrisCM和U2CO3所写的,不需要第79行末尾的;,即使它不会生成编译错误。
https://stackoverflow.com/questions/17314271
复制相似问题