If your compiler has conio.h as a header, then you're in luck, as this program shows:
If you don't have conio.h, then check out the cboard tutorial on it. There's a game in the thread at first, but keep going down the replies and you'll come to the virtual keys function that MS has set up for Windows.
kbhit Checks for currently-available keystrokes.
kbhit checks to see if a keystroke is currently available.
Any available keystrokes can be retrieved with getch or getche.
If a keystroke is available, kbhit returns a nonzero integer; if not, it
kbhit works in DOS and Windows
cprintf("Press any key to continue:");
while (!kbhit()) /* do nothing */ ;
//getchar() (below) is standard C. getch() is part of the
//non-standard (but useful), conio.h
key1 = getch(); //get a letter, w/o an enter key being needed
//print the int that was pressed, as a letter
printf("\r\nA key was pressed: %c", key1);
//print the same int as it's ascii int value
printf("\r\nA key was pressed: %d", key1);
printf("\n\t\t\t Press Enter When Ready ");
key1 = getchar(); //pause the screen from closing