I want to initialize a two-dimensional array of variable size to zero. I know it can be done for a fixed-sized array:
int myarray[10][10] = {0};
You can't create a static array using non-constant variables. Try using dynamic allocation:
int i = 10; int j = 10; size_t nbytes = i*j*sizeof(int); int* myarray = (int*) malloc(nbytes); memset(myarray,0,nbytes);