I need read the stdin in Linux, although my program will receive only messages without new line.
I tried this code, but is not working:
int main ( void )
{
char p_char[48];
memset( p_char, 0, sizeof(p_char) );
fcntl( STDIN_FILENO, F_SETFL, FNDELAY );
read( STDIN_FILENO, p_char, sizeof(p_char) );
}
Someone have a suggestion?