Author Archives: Aaron Ballman

Switching on Expressions

The switch statement is a powerful construct in C that allows you to clearly express complex if/else if/else blocks as a single statement. By providing this construct, you can write code that’s easier to understand and maintain. The downside to … Continue reading

Posted in C/C++ | Tagged , , | 1 Comment

The Plan and Random Points

For about six months, I managed to stick to a bi-weekly update schedule of Mondays and Fridays. However, I’ve exhausted my entire backlog of topics, as well as my todo list for things to write about. Instead of trying to … Continue reading

Posted in Uncategorized | Tagged , , | 1 Comment

Virtual Inheritance

A question came up on LinkedIn in the C++ group relating to how virtual class inheritance actually works. Since LinkedIn limits the amount of space for responses, and also manages to screw up code formatting, I decided to tackle the … Continue reading

Posted in C/C++ | Tagged , , | 4 Comments

Virtual Methods and Multiple Inheritance

Previously, we covered the basics behind virtual methods. If you aren’t wholly comfortable with the subject yet, I’d recommend you go check that post out first. But if you are comfortable, we’re going to delve into the wacky fun world … Continue reading

Posted in C/C++ | Tagged , | 5 Comments

How DLL Imports Work

When you make a function call into a function that exists in a DLL, what happens, exactly? How does the function call happen, and what work goes on behind the scenes to make it so? I want to cover some … Continue reading

Posted in Win32 | Tagged , , , | 1 Comment

Virtual Methods

Virtual functions are a fairly well-understood programming construct in terms of how and when to use them. But have you ever stopped to think about how they actually work under the hood? You’ve probably heard the term “vtable” thrown around … Continue reading

Posted in C/C++ | Tagged , | 7 Comments

Static asserts

One of the new features of C++11 is the ability to do a compile-time assertions. These assert functions are similar in concept to the runtime assert functions we all know and love. You pass in a constant expression and a … Continue reading

Posted in C/C++ | Tagged , | 1 Comment

Threading on Windows

Threads are becoming one of the more ubiquitous concepts in programming. Chances are quite good that you’ve a few of them before. But have you ever stopped to think about how a thread works under the hood? There are some … Continue reading

Posted in Win32 | Tagged , , | Leave a comment

Understanding Undefined Behavior

One of the harder concepts for people to understand in C++, in my opinion, is “behavior.” In C++, the language has some very specific wording for what the various behaviors are, and I’ve seen a lot of people get them … Continue reading

Posted in C/C++ | Tagged , | Leave a comment

Be Carefully Consistent With Memory

One of the things that most C/C++ programmers start to take for granted is memory. It’s always there, and when used properly, it always “just works.” However, frameworks throw a bit of a monkey wrench into the equation because they … Continue reading

Posted in Framework Design | Tagged , , | 1 Comment