Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 767 Bytes

compiler-error-c3222.md

File metadata and controls

23 lines (19 loc) · 767 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C3222
Compiler Error C3222
11/04/2016
C3222
C3222
5624bde8-2fd0-4b8b-92ce-5dfbaf91cf93

Compiler Error C3222

'parameter' : cannot declare default arguments for member functions of a managed or WinRT type or generic functions

It is not permitted to declare a method parameter with a default argument. An overloaded form of the method is one way to work around this issue. That is, define a method with the same name with no parameters and then initialize the variable in the method body.

The following sample generates C3222:

// C3222_2.cpp
// compile with: /clr
public ref class G {
   void f( int n = 0 );   // C3222
};