I wanted to know what integer/ASCII code the arrow keys were so I can get some programming exercise going. My test somehow evolved into this:
int x = getch();
printf("%c\n", x);
x = getch();
printf("%c\n", x);
x = getch();
printf("%c\n", x);
x = getch();
printf("%c\n", x);
x = getch();
printf("%c\n", x);
Problem is the code I'm getting is of a different ASCII character and that there seems to be something being left in the buffer/stream which doesn't happen when I test this using normal characters(Alphabet and such).
Basically it only lets me input three times, skipping the next getch() and printing a constant character first(int 224) then printing a character that supposedly corresponds to the arrow keys(Seeing as this changes along with changing which arrow key I press) but non the less not what I am looking for.
So I have (2) concerns.
(1) I can't determine what ASCII code the arrow keys are.
(2) There seems to be something left on the buffer/stream which doesn't happen ordinarily and skips the next getch(). I'd like to know why this happens.