This is incorrect, use should use "int main(void)".
>here (int)key is typecasts the charcter to int.
Not exactly, key is already an int because that's how is was declared. Therefore the cast isn't necessary.
Rather than coding the ASCII value of the character, you could use the character constant, like so:
This makes things easier to read.
>i got that part working but how can i then get it to go to say the game?
Does this example help?:
printf("The game has been activated\n");
int key, StillGoing = 1;
printf("--- Menu ---\n1.New Game\n2.Exit Game\n>");
switch (key = getch())
case '1': TheGame(); break;
case '2': StillGoing = 0; break;
default: printf("Option Invalid: %c\n", key); break;