Skip to content

Latest commit

 

History

History
36 lines (31 loc) · 899 Bytes

compiler-error-c2572.md

File metadata and controls

36 lines (31 loc) · 899 Bytes
title ms.custom ms.date ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
Compiler Error C2572 | Microsoft Docs
11/04/2016
cpp-tools
error-reference
C2572
C++
C2572
f1a42d69-727d-4ce5-88c8-d5f55dea66ac
8
corob-msft
corob
ghogen

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) {}