Export (0) Print
Expand All
Expand Minimize

Compiler Error C2728

cannot create non __gc array 'array' of type 'type'

A __nogc array cannot be of a __gc type.

The following sample generates C2728:

// C2728.cpp
// compile with: /clr
#using <mscorlib.dll>

int main()
{
   int __gc* arr __nogc[5];   // C2728
}
Show:
© 2015 Microsoft