This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Read Single Char
- From: Bharathi S <bharathi at lantana dot tenet dot res dot in>
- To: GNU GCC <gcc-help at gcc dot gnu dot org>
- Date: Fri, 6 Jun 2003 13:59:15 +0530 (IST)
- Subject: 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.