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?
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?
=========================================
Everytime you segfault, you murder some part of the world
When I remove the N, it gives me a warning.
=========================================
Everytime you segfault, you murder some part of the world
In C, use a #define?
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
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.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.