Try calling this function after every scanf call. You should probably get rid of this problem.
It does the same job, like what other have been saying.Code:void clr_ln_buffer( void ) { int c; while( ( ch = getchar() ) != EOF && ch != '\n' ); }
-ssharish