To make a two dimensional array, I\'m currently using the following:
int * own;
own = (int *)calloc(mem_size, sizeof(int));
for (i=0;i
Because own is declared as having type int *
int * own;
then own[i]
is a scalar object of type int
and you may not apply to it the subscript operator.
You could write the following way
int ( *own )[3] = calloc( mem_size, 3 * sizeof( int ) );
The other way is the following
int **own = malloc( mem_size * sizeof( int * ) );
for ( i = 0; i < mem_size; i++ ) own[i] = calloc( 3, sizeof( int ) );