because when first time getch() is called, it will return the ascii code of the pressing key. when second time it called then it will return the scan code of that pressing key. So when we want to control our program with arrow keys, there ascii codes are 0 but scan codes are different.
Now while working in linux environment using gcc compiler. there is no conio.h header file in it and we have such function getch(). so how can we get the scan code for arrows and functional keys in C using gcc compiler.
Re: How can we get scan code in C using gcc compiler
Hi,
If its ok the character is echoed on the screen, you can very well go for getc(stdin) or getchar() in a while loop with the termminating condition like carriage return or something you want...
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.