View Full Version : troubles..need help

11-15-2004, 02: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


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("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!


11-15-2004, 04:14 AM
Somehow the * character is being outputted in its integer value, which is 42. Take a look at this ascii table and you'll see what I mean. Other than that, I can't help ya much because I don't know C++.

11-15-2004, 05:19 AM
I figured it out
was a very stupid mistake!
but thanks for the reply