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

Carla Schroder carla at bratgrrl.com
Tue Feb 21 19:26:09 UTC 2012


On Tuesday, February 21, 2012 12:29:35 PM Kathryn Hogg wrote:
> 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.

Excellent, this is exactly the sort of clear, pertinent explanation that I 
like, and try to write myself.  (This was rather a half-baked lesson so it 
needs  help.)

Anyone who does not have a good understanding of stdin and stdout should look 
them up because they are fundamental to all computing.

And remember, there are no stupid questions-- don't be shy!

Carla

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Carla Schroder
ace Linux nerd
author of Linux Cookbook,
Linux Networking Cookbook,
Book of Audacity
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



More information about the Courses mailing list