Hi all I know that conio.h is not part of C standard but I want to use it . Is there any way to use it under linux ? thanks
Is getch an unbuffered character read, or sommat?
What're you trying to use out of conio.h?
- I'm a code junkie security enthusiast
it may be clrsrc()
Diaa Radwan
conio.h is a Borland kaka for working with DOS console IO. DOS. Not linux.
Linux uses something called curses.
--
it's a DOS only thing
If he does resurface, tell him to take a peek at setvbuf + getc and ncurses
setvbuf(stdin, 0, _IONBF, 0); c = getchar();
Dunno. It looks plausible to me, but I haven't tried it.
Would probably break 'doze sommat chronic'
n/t
I've found this solution . it works good
int getch( )
{
struct termios oldt,
newt;
int ch;
tcgetattr( STDIN_FILENO, &oldt );
newt = oldt;
newt.c_lflag &= ~( ICANON | ECHO );
tcsetattr( STDIN_FILENO, TCSANOW, &newt );
ch = getchar();
tcsetattr( STDIN_FILENO, TCSANOW, &oldt );
return ch;
}
DOS only thing
Is getch an unbuffered character read, or sommat?
What're you trying to use out of conio.h?
- I'm a code junkie security enthusiast
it may be
it may be clrsrc()
Diaa Radwan
Nothing doing
conio.h is a Borland kaka for working with DOS console IO. DOS. Not linux.
Linux uses something called curses.
--
As I mentioned
it's a DOS only thing
If he does resurface, tell him to take a peek at setvbuf + getc and ncurses
setvbuf(stdin, 0, _IONBF, 0); c = getchar();
Dunno. It looks plausible to me, but I haven't tried it.
Would probably break 'doze sommat chronic'
- I'm a code junkie security enthusiast
As you mentioned where?
n/t
--
Here
- I'm a code junkie security enthusiast
I've found this
I've found this solution . it works good
int getch( )
{
struct termios oldt,
newt;
int ch;
tcgetattr( STDIN_FILENO, &oldt );
newt = oldt;
newt.c_lflag &= ~( ICANON | ECHO );
tcsetattr( STDIN_FILENO, TCSANOW, &newt );
ch = getchar();
tcsetattr( STDIN_FILENO, TCSANOW, &oldt );
return ch;
}