0

Array error

#include <stdio.h> int main() { int n; printf("Introduce el nĂșmero de elementos: "); scanf("%d",&n); int mat[n]; return 0; } Why doesn"t this code accept 'mat' array? In other compilers accept it.

16th Mar 2022, 10:47 AM
Manuel RondĂłn
Manuel RondĂłn - avatar
5 Respostas
+ 1
because it is unused. The compiler is throwing warning because it wants to tell you that if you are not going to use a variable/array then why are you even declaring it ?đŸ€”đŸ€” either use that array or remove it.
16th Mar 2022, 1:07 PM
NonStop CODING
NonStop CODING - avatar
+ 1
It's not error. It's a warning. Manuel RondĂłn
16th Mar 2022, 2:27 PM
Jayakrishna 🇼🇳
16th Mar 2022, 2:33 PM
NonStop CODING
NonStop CODING - avatar
0
I mean in other compilers no warning no error.
16th Mar 2022, 8:39 PM
Manuel RondĂłn
Manuel RondĂłn - avatar
0
May be, there others disabled warnings in settings.. And It has no errors.
16th Mar 2022, 8:47 PM
Jayakrishna 🇼🇳