Originally Posted by
tabstop
(Ssshh: It doesn't
It works fine with the space.
Originally Posted by
tabstop
, since %s already skips spaces at the beginning.)
So what you are saying is that he has no actual problem and he's making this all up? This works with our without the space:
Code:
#include<stdio.h>
int main( void )
{
char words[4][ BUFSIZ ] = {{0}};
int x;
for( x = 0; x < 4; x++ )
{
printf( "enter a word, then hit enter: " );
fflush( stdout );
scanf( "%s", words[x] );
}
printf( "%s, %s, %s, %s\n", words[0], words[1], words[2], words[3] );
return 0;
}
The space has no adverse effect.
Quzah.