description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||
---|---|---|---|---|---|---|---|
Learn more about: Compiler Error C2058 | Compiler Error C2058 | 11/04/2016 |
|
| 81e08e6b-15f7-41b4-980a-53763e19990c |
constant expression is not integral
The context requires an integer constant expression.
The following sample generates C2058:
// C2058.cppstructalignas(1.5) S {}; // C2058intmain() { int arr[1.5]; // C2058 }
To resolve the issue, use an integer constant expression. For example, int arr[2];