[Courses] C Programming For Absolute Beginners, Lesson 2: Fun With Printf, Scanf, Puts, and Variables

Kathryn Hogg kjh at flyballdogs.com
Tue Feb 21 18:29:35 UTC 2012


On 2012-02-21 12:26, Christopher Howard wrote:
> Some discussion should probably be made of buffering issues that can
> occur while mixing reading and writing on the command-line. I.e., the
> program might start waiting for the user input before it actually 
> prints
> out the line telling the user what to enter. It's been a long time 
> since
> I have had to deal with this (normally user input is provided through
> the program arguments). However, I think it involves flushing
> stdin/stdout buffers with fflush().

Reading from stdin (which is what scanf is doing) will cause stdout to 
be flushed.

I know I'm not the instructor but lets not confuse the people learning 
with every little detail.

-- 
Kathryn Hogg
http://womensfooty.com


More information about the Courses mailing list