This is the code in VS:
int main(){
int hi = 5;
int arr[hi]{};
}
The error:
Error(active) E0028 expression must have a constant value
The same code in code::Blocks:
int main() {
int hi = 5;
int arr[hi]{};
}
There is no error.
So, how can I run this code normally in VS without changing anything in the syntax?
New contributor
the ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
4