相关疑难解决方法(0)

为什么空声明适用于带有int参数的定义但不适用于浮点参数?

我认为区别在于declaration没有参数类型......

为什么这样做:

int fuc();

int fuc(int i) {
  printf("%d", i);
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

但这无法编译:

int fuc();

int fuc(float f) {
  printf("%f", f);
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

随着消息:

错误:'fuc'的冲突类型.注意:具有默认促销的参数类型不能与空参数名称列表声明匹配

c function-prototypes function-declaration

12
推荐指数
1
解决办法
1万
查看次数