65,211
社区成员
发帖
与我相关
我的任务
分享#include <iostream.h>
int call_b(int);
void main(){
int c = 20;
int g = 0;
g = call_b(c);
}
int call_b(c){
c = c+5;
return c;
}
C:\Program Files\Microsoft Visual Studio\MyProjects\ddd\dddd.cpp(15) : error C2065: 'c' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\ddd\dddd.cpp(15) : error C2448: '<Unknown>' : function-style initializer appears to be a function definition
刚学c++ 不知道是什么原因哦
#include <iostream.h>
int call_b(int);
void main(){
int c = 20;
int g = 0;
g = call_b(c);
}
int call_b(c){ //这里的c未定义,你不告诉编译器它是什么类型的,谁知道呢 改成int c即可
c = c+5;
return c;
}
int call_b(int c){
c = c+5;
return c;
}