20 x 20 array error -> passing arg 1 of from incompatible pointer type
ok i know this may seem like a novice question, but I am really just totally aggrivated with this program, I wanted to make a 20x20 character array, and i am referring to 400 spots with a single character in each, not 20 strings of length 20. Now i have a global variable char *grid which was working before, i get all the other requirements of the program to work then out of nowhere this fails to work anymore.
for(i = 0; i < 20; i++)
for(j = 0; j < 20; j++)
fscanf(inf, "%s", &grid[i][j]);
if(strcmp(&grid[i][j], "S") == 0) //this is where the error occurs
Si = i;
Sj = j;
if(strcmp(&grid[i][j], "G") == 0)
Gi = i;
Gj = j;
Is it the way i am declaring this character array, is it actually possible to make a 20 X 20 array with a single character in each slot?
just to let everyone know, i have also declared char grid and that just does 20 strings of length 20. please can anyone help me out?!
|All times are GMT. The time now is 04:56 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.