How do I define a 2D array where the first dimension is already defined with MAX_VALUES. I wish to be able to allocate memory to the second dimension. Below is what I have attempted. I want an array with A[1000][mallocd]
#define MAX_VALUES 1000
int
main(){
int n= 10;
int *A[MAX_VALUES] = malloc(10 * sizeof(int));
}
Ahas the wrong type, the*binds to the left. You wantint (*A)[MAX_VALUES].