C 函数原型中的预期")"
expected ')' in c function prototype
我有一个在头文件和源文件之间划分的函数,如下所示,
在头文件中:
uint8_t SoundEffects(uint8_t EffectType,uint8_t RecordedSample);
在源文件中:
uint8_t SoundEffects(uint8_t EffectType,uint8_t RecordedSample)
{
// some code
}
生成以下错误
SoundEffects.h:7:错误:在"EffectType"之前应为"(">
SoundEffects.c:3:错误:在"EffectType"之前应为"(">
我已经尝试了所有的方法,删除了变量名,将uint8_t
更改为unsigned char
,但都不起作用。问题出在哪里?
确保您还没有将令牌#define
和SoundEffects
绑定到其他对象。
当'EffectType'之前的令牌未被识别为类型时,我会出现此错误。在这种情况下,为'uint8_t'。我的猜测是,您需要在头文件的顶部'include <stdint.h>'
(或者至少在包含头文件之前(。
相关文章:
- 函数如何通知用户它基于函数原型抛出异常?
- 在函数中拥有函数原型的目的是什么?
- 什么..(省略号)作为函数原型中唯一的函数参数,C++?
- 是否可以使用 libclang python 解析 cpp 文件中没有标头的函数原型
- 有没有办法在C++编译时更改函数原型?
- 省略函数原型中的返回类型
- 如何使用 "using" 关键字定义函数原型/签名
- 函数原型未初始化的局部变量
- 如何创建函数原型命名空间
- 标准库头文件函数原型的实现是如何用 c++ 编写的?
- 为什么这种类型的函数原型会引发错误?
- 函数指针类型不能用于函数原型
- 了解此函数原型
- 将字符串向量传递给函数和函数原型问题 c++
- 函数原型范围的有趣用法
- 为什么这不起作用(C++函数原型)
- 将数组传递到函数会在函数原型声明中出现错误
- 在头文件中的函数原型中获取指针数组:函数声明为 void
- 类/成员函数中的函数原型
- 函数原型中的字符串初始化