Last week’s post was on 1101, which is a binary number! My inner nerd got so excited, I aimed to write code that locates and outputs all binary dates throughout the calendar year.
Continue reading
Having Fun with goto – Solution
This month’s C programming Exercise is probably the most bizarre one I’ve ever offered! Using the goto keyword is frowned upon, which means that your C programmer brain is unaccustomed to thinking about using goto to construct, well, anything!
Continue reading
Today’s Date is Binary!
You know you’re a nerd when you look at today’s date, November 1st, as 11-01 and then you think, “That’s a binary number!” Yeah, nerd.
Continue reading
Having Fun with goto
Difficulty: ★ ★ ★ ☆
Among the C language’s slender assortment of keywords you find goto. It’s a branching statement, which can be used to loop or to escape from some ugly programming knot. Regardless, you’re told early on in your C language education that you must avoid this keyword at all costs! That is, unless you want to try this month’s exercise.
Continue reading
Filling the Pointer Pointers with Data
The final step of the pointer storage program is to add data to the various buffers, or “sticks,” where ten integer values are stored. This step involves ugly double-pointer notation. If you can, please review last week’s Lesson to get up to speed on how storage is allocated and how these pointers are managed.
Continue reading
Adding Pointers to Pointers
Expanding an allocated buffer is something you can do with a pointer, but not with an array. This flexibility is why I encourage all C language students to understand and use pointers, though it doesn’t make the concept nay less onery.
Continue reading
The Ever-Expanding Pointer Array
Perhaps the most difficult part of learning C is understanding and coding pointers. Even when you have a grip on things, it helps to keep fresh and practice new and utterly obnoxious ways to play with pointers.
Continue reading
Heron’s Formula – Solution
The challenge for this month’s Exercise is to code Heron’s Formula. This geometric magic calculates the area of a triangle given the length of each of its three sides.
Continue reading
Coding a Better stringcopy() Function
From last week’s Lesson, the task is to code a safer, better version of the strcpy() function. The goals are to check buffer size, report an overflow or underflow (buffer is too big or too small), and potentially confirm whether data is overwritten. Such a program is often used as a test when applying for a C programming job.
Continue reading
Heron’s Formula
Difficulty: ★ ★ ☆ ☆
The only aspect of math I enjoyed in school was geometry. Trigonometry was a close second. I found the study fascinating and did well; I received a B in that class as opposed by my usual C- or D.
Continue reading