Read Single Char

John Love-Jensen eljay@adobe.com
Thu Jun 5 12:46:00 GMT 2003


Hi Bharathi,

Probably because you are doing something like this on the input stream:
1\n2\n3\n4\n5\n

(Where '\n' represents a newline, 0x0A, decimal value 10.)

Change your scanf to this:
    scanf("%c\n", &c);

Sincerely,
--Eljay



More information about the Gcc-help mailing list