hello, my code (as follows) is not working. I am trying to give a different message for each of the different wsad keys that are pressed (to turn into a game later on). The current code is as follows:
Code:
char up_key=="w";
char down_key=="s";
char left_key=="a";
char right_key=="d";
int c;
void main()
{
c==getch();
if (c==up_key);
goto up;
dead:
{
printf ("ZZZZZZZZZZZ");
system("pause");
}
up:
{
printf ("ello");
printf("\nThe letter number for %c is %d. Press a key.");
system("pause");
}
}
I have heard of giving each key a different # value, but would like to take the easy rout if possible by having the key presses recognized. Thanks!