I was trying to find the character code for arrow keys so wrote this-
char x=_getch();
cout<<(int)x;
No matter which arrow key I pressed it printed -32. Then I added one line and my code looked like this-
char x=_getch();
x=_getch();
cout<<(int)x;
With the above code it was printing correct values. Can anyone explain why this is happening.
I am using Code::Blocks with GNU GCC Compiler.