I have declared two variables:
int N = 0;
int outBound[N];
When I compile it gives me the error: variable-size type declared outside of any function.
How could I fix this?
Printable View
I have declared two variables:
int N = 0;
int outBound[N];
When I compile it gives me the error: variable-size type declared outside of any function.
How could I fix this?
When I remove the N, it gives me a warning.
In C, use a #define?
Change "int N = 0;" to "const int N = 0;". Why would you want it as 0 anyways?
You can't have arrays based on the value of a variable in C.
If you want N int's, then you're going to have to malloc them at run-time.