Compiler Error C2572


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at Compiler Error C2572.

class::member' : redefinition of default parameter : parameter param

Default parameters cannot be redefined. If you require another value for the parameter, the default parameter should be left undefined.

The following sample generates C2572:

// C2572.cpp  
// compile with: /c  
void f(int i = 1);   // function declaration  
// function definition  
void f(int i = 1) {}   // C2572  
// try the following line instead  
// void f(int i) {}