I am trying to allocate the array from command line inputs in the following way.. but I am still getting warnings.. pasted the error message below.. please look into it.. what changes could make this code perfect..
int ni = atoi(argv[1]);
int nj = atoi(argv[2]);
int *a[ni][nj];
for(i=1; i<ni; i++)
{
for(j=1; j<nj; j++)
{
a[i][j] = 10*j + i;
}
printf("%d", a[i][j]);
}
Compiler oputput:
In function main:
warning: incompatible implicit declaration of built-in function malloc
warning: assignment makes pointer from integer without a cast