What does an "incomplete type" error mean?

I am trying to declare a callback procedure 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 am not sure how to fix this. I have other similar callback procedures declared in the same header file and I am not getting this error.

Please, help!:)

+5
source share
2 answers

You cannot use new because it is a keyword. Try to select a valid identifier for your second argument.

+19
source

You cannot name a variable (or any identifier) ​​with a reserved word;

reserved words are keywords

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

and and_eq bitand bitor compl not
not_eq or or_eq xor xor_eq
+7

All Articles