I want to make code that will run portably under Linux, but unfortunately it does not like conio (non-portable). But, is there another, easier way to do getch() that is portable?
I want to make code that will run portably under Linux, but unfortunately it does not like conio (non-portable). But, is there another, easier way to do getch() that is portable?
How about:
int fgetc(FILE *stream)
Try not.
Do or do not.
There is no try.
- Master Yoda
FILE * stream?
if you're reading from keyboard use fgetc(stdin)
Try not.
Do or do not.
There is no try.
- Master Yoda
fgetc() is not like getch(), the big difference being line bufferedOriginally posted by Cshot
How about:
int fgetc(FILE *stream)
hello, internet!
Oops. I thought he said getchar.
Try not.
Do or do not.
There is no try.
- Master Yoda
What about plain ol getch()?
Most linux systems support the getch function. It's located in the curses library
vVv, you're absolutely right about the FAQ thing and the portability of the curses library. I only wanted to inform Nakeerb about the getch function in the curses library.
Why don't you send a PM to kermi3 about the getch issue? I'm sure he can add it to the FAQ.