自由輸入鍵盤,即時顯示ASCII Code 數值
改良版:
getche( )
int main(int argc, char *argv[])
{
char r1, r2='5'; //'A' = 0x41 = 65
int i = 0;
while( 1 )
{
//printf( "\n <%c>ASCII code =<0x%X>=<%d>",r2,r2,r2);
printf( "\n <");
r1 = getch();
//scanf("%d", &r1);
printf( "%c>=ASCII=<0x%X>=<%d>\n",r1,r1,r1);
}
return 0;
}