我真的很新的C++,这是我上的Visual Studio 2015年第一个程序,它显示了我2个错误:“{”缺少函数头(旧式格式列表) - 预期声明
“ {”缺少函数头(旧式格式列表) 预期的声明
#include "stdafx.h"
#include <iostream>
int main();
{
cout << "Hello World";
return 0;
}
我真的很新的C++,这是我上的Visual Studio 2015年第一个程序,它显示了我2个错误:“{”缺少函数头(旧式格式列表) - 预期声明
“ {”缺少函数头(旧式格式列表) 预期的声明
#include "stdafx.h"
#include <iostream>
int main();
{
cout << "Hello World";
return 0;
}
int main()
删除;最后。
#include "stdafx.h"
#include <iostream>
int main(); // this ';' is giving problem remove it.
{
std::cout << "Hello World"; // use std::cout
return 0;
}
下一个错误:它被称为'std :: cout'。 – juanchopanza
@juanchopanza,对,但在某些编译器中,它也可以与它一起运行。谢谢,我也会将其添加到答案中。 – Himanshu
一个不符合标准的人可能? – juanchopanza
'int main()'remove';'end。 – Himanshu