I set a constant value

#define N 100 int main() { int A[N] [N]; //почему это неправильно? И как нужно чтобы компилятор не ругался (VS2017) ? int i, j; ..... 
  • I do not see VC ++ swear at your ad. Maybe he curses you for something else? You do not hesitate to bring all the information, otherwise you act as a postman Pechkin: "I have a package for you, but I will not give it to you!" - Harry
  • how exactly does the compiler swear? - Enikeyschik
  • Why did you delete the rest of the code? - Enikeyschik 4:04
  • Did you need him? - Notoriuss 4:08
  • And what did you answer now? It turns out, looking at the question - two fools from somewhere have found a problem that doesn’t exist in the given question, so the answers have nothing to do with the question ... Bring it all back, otherwise it turns out stupid. - Harry

2 answers 2

Your

 int N; 

due to

 #define N 100 

turns into

 int 100; 

which is completely incomprehensible to the compiler, because it is not a correct C construct. Just remove this line — you do not need it.

    The code has #define N 100 and int N; . One of N must be renamed. And never again give variable / macro names to variables (and not use single-letter names at all).

    • scanf ("% d", & N); int A [N] [N] = {0}; Why not do this? - Notoriuss 4:04
    • This is an independent question. New issue - new topic. - Enikeyschik 4:04