This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Read Single Char


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]