2013-06-26 143 views
-2

我在第60行在我的任务中遇到了标题问题。请任何人尽快帮助我。预计'{'令牌之前的非限定id C++

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 }; 

错误:预期 '{' 令牌C++在线路之前不合格-ID 60

+1

删除59行上的最后一个分号 – bobah

+5

这个问题似乎是无关紧要的,因为它是关于打字的。 – 2013-06-26 07:44:32

+0

我不知道如何快速谷歌搜索有关确切的错误没有回复你的问题... – Joum

回答

6

在线路59

的端部通过该方式取出;,如ChrisCM和Li 2 CO 3已经写,则不需要在行79末尾的;,即使该行不会生成编译错误。

+1

第79行的那个也是不必要的。 – ChrisCM

+0

@ChrisCM - 查看我的答案。 :D – 2013-06-26 07:43:59

+0

@ H2CO3 ChrisCM的评论大概是在你之前的10秒:D –

0

它似乎误它是在第59行

void storeFile(); 

增加了;

void storeFile() 
+0

我删除了;从第59行开始,但现在在第74行第13列出现错误[Error] expected';' 'VUID'之前 –

1

替换它并可能删除线79的一个了。

相关问题