You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C does not allow a variable to define an array size. For example, in line 10-11 of qsort.c it shows...
int size = 5;
int a[size] = {5, 4, 1, 3, 2}; // This creates an error.
Main.c:11:4: error: variable-sized object may not be initialized
11 | int a[size] = {5, 4, 1, 3, 2};
instead, use
#define size 5
int a[size] = {5, 4, 1, 3, 2};
The text was updated successfully, but these errors were encountered:
C does not allow a variable to define an array size. For example, in line 10-11 of qsort.c it shows...
int size = 5;
int a[size] = {5, 4, 1, 3, 2}; // This creates an error.
Main.c:11:4: error: variable-sized object may not be initialized
11 | int a[size] = {5, 4, 1, 3, 2};
instead, use
#define size 5
int a[size] = {5, 4, 1, 3, 2};
The text was updated successfully, but these errors were encountered: