vc编程时出现error C2449: found '{' at file scope (missing function header?)这个错误,第11行。求解

void list(ADDRESS t[],int n)
{
int i;
system("cls");
printf("\n\n*******************ADDRESS******************\n");
printf("name unit telephone\n");
printf("------------------------------------------------\n");
for(i=0;i<n;i++)
printf("%-20s%-30s%-10s\n",t[i].name,t[i].units,t[i].tele);
if((i+1)%10==0) /*判断输出是否达到10条记录*/
{
printf("Press any key continue...\n"); /*提示信息*/
getch(); /*压任意键继续*/
}
printf("************************end*******************\n");
}

// C2449.c
// compile with: /c
void __stdcall func(void) {} // OK
void __stdcall func(void); // extra semicolon on this line
{ // C2449 detected here
------------------
请把代码完整的贴上来,这个错误不是说你少了大括号,而是括号前面没有函数头之类的。你那说的第11行,肯定不是说你这贴的函数第11行吧?
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-12-06
一般应该是缺少对应括号报的错,但是你的代码没什么问题。追问

是啊,就是提示error,没办法啊

第2个回答  2012-12-06
是不是你在定义函数时后面多了个分号追问

你看见我的代码没,不是没有吗?就是因为没有多分号我才问的。前面百度过这个问题一般都是多分号,可我没有啊啊

追答

你贴一下全部代码吧。

相似回答