I want to initialize 2d array with default 0 values.
rows and columns are dynamically changed values
int data[rows][columns] = { {}, {} };
And getting error
error: variable-sized object 'data' may not be initialized
int data[rows][columns] = { {}, {} };
What I did wrong?
#define rows (6)or something like that. The pre-processor will substituterowswith a number. We just do not know the code before. (however, it is just an hypothesis)