Compiler Error C2058
constant expression is not integral
The context requires an integer constant expression.
The following sample generates C2058:
// C2058.cpp
struct alignas(1.5) S {}; // C2058
int main() {
int arr[1.5]; // C2058
}
To resolve the issue, use an integer constant expression. For example, int arr[2];
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for