Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Error C2728
Collapse the table of content
Expand the table of content

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
© 2015 Microsoft