I wrote a code on windows, using the function getch() from stdio. The thing is I have to use an input function that does not require pressing enter.
My code compiles and works perfectly on windows. However, this assignment has to run on linux, and when I try to do so, it tells me it does not recognize getch() (or _getch()).
The problem is that according to the assignment, I can not use other includes but stdio.h (and same goes for adding a flag), so I can not use curses.h to solve this.
I also can not use termios.h and so on, we have not learned it.
How can I solve this? Are there any other options?
Thanks
getchar()function can retrieve a single character, but it won't (by default) receive an answer until the carriage return is pressed. You must disable buffering in order to get past that limitation however your question suggests you're not permitted to do that -- meaning you cannot complete this assignment.