Difficulty: Easy
The C compiler preprocessor is a sneaky and powerful thing. I’m unsure of any other programming languages that have such a tool.
Continue reading
The C compiler preprocessor is a sneaky and powerful thing. I’m unsure of any other programming languages that have such a tool.
Continue reading
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.
Continue reading
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.
Continue reading
The defined constant NULL represents a null or empty pointer. I’ve written before that the constant isn’t defined as zero, though such an assumption could lead you into trouble.
Continue reading
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.
Continue reading
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.
Continue reading
I hope you had a wee bit of a struggle with your solution to this month’s Exercise. It involves a lot of decisions and proper steps in the right order to hold off on debits so that the bank account never dips below zero.
Continue reading
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.
Continue reading
Your bank receives two deposits or credits and three bills or debits. The credits cover the debits, meaning that your balance should never go below zero, but the bank has clever software: The bills are calculated first, which thrusts your account into negative territory complete with fees — even though the deposits cover the bills. Is this obnoxious behavior the result of greedy bankers or clever programming?
Continue reading
The strfmon() function, introduced in last week’s Lesson properly formats a monetary value for specific regions. To unlock the function’s various features, you must understand and use formatting placeholders.
Continue reading