gpt4 book ai didi

c - C 方法中有关 Float 和 Int 的错误

转载 作者:太空宇宙 更新时间:2023-11-04 04:38:46 24 4
gpt4 key购买 nike

所以我试图用 C 编写一个基本程序,其中包含一个方法,但在编译程序时不断出现错误,这是由于我的方法所致

我一直收到这样的错误

curve.c: In function ‘compute_curve’:
curve.c:32:7: error: argument ‘f’ doesn’t match prototype
float compute_curve(f)
^
curve.c:6:7: error: prototype declaration
float compute_curve(float);

我是这个编译的新手所以很好奇我在哪里搞砸了 float 和整数

最佳答案

您的原型(prototype)也需要像 float compute_curve(float x) 一样声明一个变量名,您的实际实现定义也应该与之匹配。

关于c - C 方法中有关 Float 和 Int 的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28533230/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com