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]

Re: Read Single Char


On Thu, 5 Jun 2003, John Love-Jensen wrote:

Thanks John,

> Probably because you are doing something like this on the input
> stream: 1\n2\n3\n4\n5\n      Change your scanf to this:
>     scanf("%c\n", &c);

1st time, this go next stat only after reading 4 char ( 1\n2\n ). But 
the outputs are correct. I am getting the output 1 after entering 2.

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]