void add_a_book (BOOK book_array[])
{
int i=0;
/* Search the array for an empty position.
An empty position has a 0 for the book number */
while ( book_array[i].number != 0 && i < SIZE )
i++;
if ( i == SIZE )
printf("\nSorry, the database is full\n");
else /* Add the books details to the database. */
{
printf( "\f\nBook Number (1 to 3 digits, except 0) : " );
do
scanf( "%3d",&book_array[i].number );
while (book_array[i].number <= 0 );
printf("\nBook Name (Maximum 30 characters) : " );
scanf("%s",&book_array[i].name );
//printf("\nBook Status (Y)es or (N)o : " );
//scanf("%c",&book_array[i].status );
}
}
how would i go about flushing the buffer after the second scanf and why is this a problem?