[sdiy] OBJECT ORIENTED C in synth programming

Thomas Strathmann thomas at pdp7.org
Sat Apr 9 14:37:00 CEST 2011


On 4/8/11 21:26 , Scott Gravenhorst wrote:
> While printf et al works great with a screen, you are correct that such
> an expression is useless where there is no screen.

printf and friends write to (or read from) stdout (or stdin 
respectively) which can be tied to a terminal that happens to be
on screen, but they can just as well be directed anywhere else.

Actually learning about printf itself is an enlightening experience 
because you get to think about questions like "What happens when you 
have a format string that calls for more arguments than I have supplied 
to the call to printf?" or "What if the format string does not 'match' 
the 'type' of the argument?" It's where you can learn valuable lessons 
about what it means to be programming in C. Along with memory management 
it's not terribly relevant to an AVR or other 8-bit micros, but learning 
a programming language involves more than just looking at examples from 
the domain you're interested in. That's more the benchmarking phase of 
determining whether the language is appropriate for the job. That's my 2 
Euro cents, YMMV.

	Thomas



More information about the Synth-diy mailing list