Read Single Char

Bharathi S bharathi@lantana.tenet.res.in
Thu Jun 5 11:51:00 GMT 2003


Hello All,

The following prg is taking the value 10 (Enter ? ) in the every 2
pass. fflush - No use. What is the reason ? 

main(){

 char c;
 int  i;

 for( i=0; i<=10; i++ ){
    fflush(stdin);
    scanf( "%c", &c );
    printf("\n Input[%d] ==> %d", i, c);
 }
}

TIA,
-- 
Bharathi S, IndLinuX Team,   (__)
DON Lab,    TeNeT Group,     oo )
IIT-Madras, Chennai-INDIA.   (_/\ 

Don't scream for the Change. Become the Change.



More information about the Gcc-help mailing list