...

View Full Version : troubles..need help



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

Antoniohawk
11-15-2004, 03: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++.

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum