G
Gattaca
I would like to create a matrix[j] of integers by allocating memory
dynamically (malloc or calloc) because i and j are defined during
execution of the program.
I have got not problem to do this in the static way. For instance, if I
want to declare a matrix 20x10 of integers and then to access
matrix[15,8] element:
int matrix[20][10];
int a;
a=matrix[15][8];
But I havn't the clue to do it dynamically in case of i=20 and j=10.
int i,j,a;
i=20;j=10;
Thanks for your help,
Gattaca
dynamically (malloc or calloc) because i and j are defined during
execution of the program.
I have got not problem to do this in the static way. For instance, if I
want to declare a matrix 20x10 of integers and then to access
matrix[15,8] element:
int matrix[20][10];
int a;
a=matrix[15][8];
But I havn't the clue to do it dynamically in case of i=20 and j=10.
int i,j,a;
i=20;j=10;
Thanks for your help,
Gattaca