C++多加一个大括号编译出错

#include"iostream.h"
int main();
这样编译没问题

#include"iostream.h"
int main();
{
这样编译就出错误了 怎么回事?

错误:
①#include "iostream"//标准语法当中,系统定义的头文件用<>括起来,程序目录下的,自己建立的头文件才用""括起来。
②每一对个{都要有}对应。

请问,您用的什么编译器?
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-02-04
#include"iostream.h"
int main() //标准写法不能加;
{
return 0;
} //每个函数都要有括号对应追问

#include"iostream.h"
int main();
{
return 0;
}
这样还是无法通过编译

追答

#include
int main()
{
return 0;
}

第2个回答  2012-02-04
我想说的是大括号小括号在c/c++(或者其他语言)都是以成对的方式出现的,虽然你前面的int main()后面加了";"相当于是函数的声明 但是还是不能只写 大括号的一边追问

#include"iostream.h"
int main();
{
return 0;
}
这样还是无法通过编译