我正尝试在 C++ 中声明一个回调例程,如下所示:
void register_rename (int (*function) (const char *current, const char *new));
/*------------------------------------------------------------*/
/* WHEN: The callback is called once each time a file is received and
* accepted. (Renames the temporary file to its permanent name)
* WHAT: Renames a file from the given current name to the specified new name.
*/
但是,我收到以下错误:
line 204: error #70:
incomplete type is not allowed
void register_rename (int (*function) (const char *current, const char *new));
我不确定如何纠正这个问题。我在同一个头文件中声明了其他类似的回调例程,但我没有收到此错误。
求助! :)
最佳答案
您不能使用 new,因为它是关键字。尝试为您的第二个参数选择一个有效的标识符。
关于c++ - "incomplete type is not allowed"错误是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2222939/