T
T
Terminator1233212020-01-15 18:21:14
C++ / C#
Terminator123321, 2020-01-15 18:21:14

Why does Visual Studio c++ swear?

In Visual Studio for the first time, and here
It is strange, since the same CodeBlocks does not say anything about this at all
Help, please

const int n = 10;
int mas[n];

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
res2001, 2020-01-15
@Terminator123321

It's not strange - different compilers behave differently. In addition, the degree of abuse of the compiler is very dependent on the compilation options.
Here's what they write about this error in Microsoft .
The description doesn't really help either.
Try making n static. Or define as define.

#
#, 2020-01-15
@mindtester

I don't swear
ZHyJoje.png

made a project according to the console application template. inserted your lines. there are no errors
like in the original version, where the screen was, the error line was 20.
and the 20th line you have there, this is the closing curly brace main
, all this makes you think that the problem is not in these 2 lines

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question