简体   繁体   English

为什么函数的类型冲突会导致Clang错误?

[英]Why conflicting types for function is giving error in Clang?

在此处输入图片说明

I have seen a similar question like this on this site, and everyone basically said to change the function's name that was in conflict with stdio.h . 我在此站点上看到过类似的问题,每个人基本上都说要更改与stdio.h冲突的函数的名称。

However, I have changed every function's name multiple times and it still gives me this error. 但是,我多次更改了每个函数的名称,但仍然给我这个错误。 But why? 但为什么?

Never post the code in the image . 切勿在代码中张贴代码

The problem is that you call functions that main() hasn't seen before, so do: 问题是您调用了main()之前从未见过的函数,所以请这样做:

float getCelcious(void);

int main(void) {
  ...
}

float getCelcious(void) {
  ...
}

Take a look here please: Function Declaration and Function Prototypes . 请在这里看看: 函数声明和函数原型

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM