printf( "Enter ......\n" );
printf( "Enter EOF to end input.\n" );
printf( "? " );
scanf( "%d%s%lf", &account, name, &balance );
while ( !feof( stdin ) )
{
fprintf( cfPtr, "%d %s %.2lf\n", account, name, balance );
printf( "? " );
scanf( "%d%s%lf", &account, name, &balance );
}
Right now, if the user returns an empty line, I get a repeat of '?' on the output until I kill the program. Basically, what I'm wanting is to be able to detect no input given, and work with that condition. I'm certain this isn't the code to do it, but Google searches on the subject haven't turned up anything terribly useful. I hope this is all clear enough, and I really appreciate any and all help in advance. Thanks.


Sign In
Create Account

Back to top









