I am trying to declare a callback routine in C++ as follows:
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.
*/
However, I get the following error:
line 204: error #70:
incomplete type is not allowed
void register_rename (int (*function) (const char *current, const char *new));
I'm not sure how to correct this. I have other similar callback routines declared in the same header file, and I do not get this error.
Please help! :)
You cannot use new because it is a keyword. Try to pick a valid identifier for your second argument.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With