expected constructor, destructor, or type conversion before ‘(’ token|
1 #include <iostream> 2 #include <stdio.h> 3 using namespace std; 4 5 int f() 6 { 7 cout<<"hello world"<<endl; 8 return 4; 9 }; 10 //cout<<"hello world"<<endl; 11 printf("hello world\n"); 12 int s = f(); 13 14 int main() 15 { 16 return 0; 17 }
11行错误!
C++中,全局域只能声明,初始化变量,不能对变量进行赋值,运算,调用函数等操作。