Partager via


Compiler Error C2383 

Error Message

'symbol' : default-arguments are not allowed on this symbol

The C++ compiler does not allow default arguments on pointers to functions.

This code was accepted by the previous version's compiler but now gives an error. For code that works in all versions of Visual C++, do not assign a default value to a pointer-to-function argument.

For more information, see Summary of Compile-Time Breaking Changes.

The following line generates C2383:

// C2383.cpp
// compile with: /c 
void (*pf)(int = 0);   // C2383
void (*pf)(int);   // OK