Lippy
11-15-2004, 01:53 AM
Hey... the problem I have I bet is a simple one to solve..
It doesn't make sense to me why it isn't working but maybe someone can help...
if I declare a char variable in C
so:
char Board[10][10]
and then I use a for loop to go through it and set certain coordinates to a * symbol...
for(LCV=0; LCV<Civ; LCV++)
{
printf("Row: ");
scanf("%d", &Row);
printf("\n");
printf("Col: ");
scanf("%d", &Col);
Board[Row-1][Col-1] = '*';
}
assume everythings declared properly... the problem i'm having is its setting those spots in the array to 42... which is kinda frustrateing cause I can't get it to set those spots to the actual '*' character... lemmie know what ya think thanks!
Lippy
It doesn't make sense to me why it isn't working but maybe someone can help...
if I declare a char variable in C
so:
char Board[10][10]
and then I use a for loop to go through it and set certain coordinates to a * symbol...
for(LCV=0; LCV<Civ; LCV++)
{
printf("Row: ");
scanf("%d", &Row);
printf("\n");
printf("Col: ");
scanf("%d", &Col);
Board[Row-1][Col-1] = '*';
}
assume everythings declared properly... the problem i'm having is its setting those spots in the array to 42... which is kinda frustrateing cause I can't get it to set those spots to the actual '*' character... lemmie know what ya think thanks!
Lippy