a while ago on the javascript board someone asked how to find out the ascii code of a letter, a response gave him the anser and a nice little page that when a key was pressed it would alert the ascii code, well i just started to learn c about a week ago, and i figured out how to do it.
Code:
#include <stdio.h>
void main() {
char key;
printf("press any key:");
key=getchar();
printf("the key was %c\n",key);
printf("the ascii code is %i\n",key);
}
this was tested on redhat 8.0 using the gcc compiler, and it worked great. BTW if you want to find out the ascii code of like the arrow key (->) hit it and then hit enter, it should work.
p.s. if you use dos and windows, chang getchar() to getch(); and add #include <conio.h>