Patterns: Initialize Everything

malloc(): memory corruption When you look at an error message like that, what could possibly lead you to believe that, a hundred lines up, you didn't properly initialize a size variable? After all, all we know is that this malloc() operation could not complete because the memory it should be able to touch is corrupted. Yes,

Patterns: Too Much Information

How many times have I seen this pattern in object oriented code? Public Class All members of the class are private All members can be accessed with accessor functions All members can be changed with modifier functions I hate to break it to y'all, but that's just a struct. The only thing you've done is add a hundred lines

Linux + C – Structures, Switches, and Your First Header

This will be a bit of a longer section, because I couldn't think of a fun way to write the code otherwise. Bonus! Structures A structure is a data element defined by the programmer which contains several member data elements. We define these structures to allow ourselves to handle a set of related data much more

Linux + C – Doing the Math I

If we're being honest, we don't start programming because we want to print out clever one-liners to a terminal. We want to calculate something complicated or massive, and we want to do it quickly. Variables, functions, and symbols We all know what a number is, right? We may behind many countries in mathematics and science, but