Submitted by noty on Mon, 09/01/2006 - 20:25.
( categories: )

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


DOS only thing

Pronco's picture

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

- http://pronco.manalaa.net

it may be

Conceptor's picture

it may be clrsrc()


Diaa Radwan

Nothing doing

YoussefAssad's picture

conio.h is a Borland kaka for working with DOS console IO. DOS. Not linux.

Linux uses something called curses.

-- Panem et *burp* circenses

As I mentioned

Pronco's picture

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

- http://pronco.manalaa.net

As you mentioned where?

YoussefAssad's picture

n/t

-- Panem et *burp* circenses

Here

Pronco's picture

DOS only thing


- I'm a code junkie security enthusiast

- http://pronco.manalaa.net

I've found this

noty's picture

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;

}

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.