I hope you enjoyed crafting your solution for this month’s Exercise. It’s just for fun, as I assume no one is going to mess with C to such a degree that their code becomes so completely unrecognizable. Still, C coders are a mischievous bunch.
The C11 standard added the “underscore” bunch to the C language’s traditional keywords:
I don’t routinely use any of these in my programs, beyond trying a few out to see how they work. The _Bool keyword comes in handy. The rest? Well, they’re worth exploring from a curiosity standpoint. For this week’s Lesson, I reveal the mysteries of the _Generic keyword.
The C compiler preprocessor is a sneaky and powerful thing. I’m unsure of any other programming languages that have such a tool.
My approach for initializing a buffer is to use a loop and assign each byte a value such as zero or the null character,
'\0'. It’s tedious, but necessary. And for the impatient, some functions are available to perform this task for you.
When my code requires a random odd buffer, I generally assign it a given size in some holy computer value: 16, 32, 64, and so on. But a defined constant exists,
BUFSIZ, that can also be used to set a buffer size safely and consistently on all C compilers.
Today marks 8 years that this blog has been online. The first post was made April 13, 2013. The blog was up for a few months before the book C Programming For Dummies was released. This way material would be available for the first readers.
Mathematicians truly enjoy doing their math thing. As a mortal human, I don’t have a spot for math things on my “fun” spectrum. Yet, one of the more jolly things the math nerds do is discuss the value zero.
I recall the math class where negative numbers were introduced. I was appalled. From Star Trek, I easily accepted the concept of antimatter, but the notion of negative values deeply offended me.