The C language features a host of symbols that take on different meanings depending on how they’re used. Unless you’re careful, these operators’ multiple personalities can confuse the bejeebers out of you.
Continue reading
Category Archives: Lesson
Three Choices
Either-or decisions are easy. They’re similar to the 1 or 0 of low-level programming: True/False, On/Off, Yes/No. When a third element appears, decision-making becomes more complex. To put it another way: That third element can drive both the programmer and the program crazy.
Continue reading
Conversion Character Mania: The Rest
I don’t think I’ve ever seen the full lot of printf() conversion characters explained in any detail. This lesson is the last in a series of my attempt to do just that.
Continue reading
Conversion Character Mania: Text Output
The printf() function’s conversion characters %s and %c seem to be rather straightforward. Or are they?
Continue reading
Conversion Character Mania: Floating Point Output
Perhaps the most complex and bizarre things you can format with printf() conversion characters are floating point numbers. The variety of the options can be overwhelming.
Continue reading
Conversion Character Mania: Integer Output
The printf() function’s power lies in its formatting abilities, specifically the display of values. That power is vast, but the documentation showing how it works really sucks.
Continue reading
Conversion Character Abuse
The printf() function is most concerned with getting the number of conversion characters — the % placeholders — to match the number of variables specified. Beyond that, it’s rather ambivalent as to whether the types match properly.
Continue reading
The C Variable Myth
A variable in C is a myth. Oh, yeah, it’s a location in memory. That’s pretty much it. After declaring the variable, the compiler — and you, the programmer — pretty much rely upon faith that the variable works and can actually be useful.
Continue reading
The Month Array
Why present the current date as 8/31/2013 when you can express it as August 31, 2013? Because some things are easy to program and some are easy for the program’s user to read.
Continue reading
Why Not Float All the Time?
What’s the point of using integers when you could simply code programs using floating-point values all the time to always get the best results? The reason is a good one, but it takes some explaining.
Continue reading