I write small program in C.
The code of the program is below.
#include<stdio.h>
#include<conio.h>
int main()
{
char ch;
int count = 0;
while(1){
ch = getch();
count++;
printf("%d\n",count);
}
return 0;
}
when i run this application when i press any key count increases one by one,
but when i press ARROW KEYS count increases two by two.
What is the problem. And how to fix it?
OS:Windows 7
IDE: Dev-Cpp with MINGW
EDIT #1:
when i print ch on the screen like
printf("%d",ch);
it shows two digits: for example -32 and 77 for left arrow key.
so how can i fix it.