A better option would be to use
fgets[
^]. It includes the newline character that is read but that can be stripped off easily with a function like this :
void StripChar( char * buffer, int chr )
{
char * p = strchr( buffer, chr );
if( p )
* p = 0;
}
Here's a small sample :
#define BUFFER_SIZE 79
char buffer[ BUFFER_SIZE + 1 ] = { 0 };
fgets( buffer, BUFFER_SIZE, stdin );
StripChar( buffer, '\n' );