I want to make a random sized array everytime program executes at first but compiler yells me
"Error 2 error C2466: cannot allocate an array of constant size 0"
Is there any way that I can randomly choose the SIZE
by SIZE = rand() % 100
at the beginning and then intialize the array with int myarray[SIZE]={0}
??? or should I everytime initialize it with an exact number at the beginning?
int main(void) {
int i;
int SIZE=rand()%100;
int array2[SIZE]={0};
for(i=0;i<SIZE;i++) //fill the array with random numbers
array2[i]=rand()%100;
...
}