Bla*_*de3 6 c++ compiler-errors keyword
我试图在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.
*/
Run Code Online (Sandbox Code Playgroud)
但是,我收到以下错误:
line 204: error #70:
incomplete type is not allowed
void register_rename (int (*function) (const char *current, const char *new));
Run Code Online (Sandbox Code Playgroud)
我不知道如何纠正这个问题.我在同一个头文件中声明了其他类似的回调例程,我没有收到此错误.
请帮忙!:)
您不能使用保留字命名变量(或任何标识符);
保留字是关键字
asm do if return try
auto double inline short typedef
bool dynamic_cast int signed typeid
break else long sizeof typename
case enum mutable static union
catch explicit namespace static_assert unsigned
char export **new** static_cast using
class extern operator struct virtual
const false private switch void
const_cast float protected template volatile
continue for public this wchar_t
default friend register throw while
delete goto reinterpret_cast true
Run Code Online (Sandbox Code Playgroud)
以及一些运营商的替代名称
and and_eq bitand bitor compl not
not_eq or or_eq xor xor_eq
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
18361 次 |
| 最近记录: |