Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 752 Bytes

compiler-error-c2728.md

File metadata and controls

29 lines (22 loc) · 752 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C2728
Compiler Error C2728
11/04/2016
C2728
C2728
65635f91-1cd1-46e4-9ad7-14726d0546af

Compiler Error C2728

'type' : a native array cannot contain this type

Array creation syntax was used to create an array of managed or WinRT objects. You cannot create an array of managed or WinRT objects using native array syntax.

For more information, see array.

The following sample generates C2728 and shows how to fix it:

// C2728.cpp
// compile with: /clr

int main() {
   int^ arr[5];   // C2728

   // try the following line instead
   array<int>^arr2;
}