【发布时间】:2017-06-19 17:22:26
【问题描述】:
我的头文件中有这个:
const char * keyBoard();
在我的一个 C 文件中,函数是这样的:
const char * keyboard()
{
//mycode
return string;
}
我的编译器出现此错误:
error: conflicting types for 'keyBoard'
const char * keyBoard(char hintTxt[30], int maxNumbers, bool multiLine)
....................^~~~~~~~
note: an argument type that has a default promotion can't match an empty parameter name list declaration
{
^
(in header file) note: previous declaration of 'keyBoard' was here
const char * keyBoard();
....................^~~~~~~~
我不关心中间部分,因为我不知道它现在是否重要,但是整个“'keyBoard' 的冲突类型”废话是什么?据我所知,它们完全相同,我在这个主题上找不到任何帮助
【问题讨论】:
-
what is with the whole "conflicting types for 'keyBoard'" crap..这是 废话 因为你的代码,不要责怪编译器。 -
错误信息与您的代码不匹配
-
@FelixPalmen 或者更确切地说,这里的代码显示。
-
顺便说一句 -
keyBoard!=keyboard.
标签: c function declaration