Category Archives: C Programming

Understanding Pointers (with Lego) Part 1

Ahhh pointers. I’ve been wanting to write a series of posts on pointers for a long time. When I’ve finished, I’ll upload a complete PDF eGuide. In the meantime, enjoy 🙂 Pointers. A concept that some programmers avoid through fear, others abuse through ignorance, and yet others manage to use with grace and efficiency. Every […]

How To Compile a 32-bit Executable on 64-bit Fedora 19

You know how sometimes you just have to compile and run a 32 bit program on a 64 bit machine, and it’s really annoying that it doesn’t seem to work? Yeah, me too. Turns out it’s actually pretty straightforward on Fedora 19. First of all, you need to use the -m32 build flag. Below I’m […]

Eclipse CDT + GDB: Setting Watchpoints (Juno)

I was trying to watch a variable in Eclipse today and just could not find how to set it up. No matter what I did the Toggle Watchpoint option remained greyed out. A watchpoint is more fun than a regular breakpoint, because the debugger will stop whenever the variable is changed, even if your program […]

Unions in C

Unions – ew. As primarily a C++ programmer, I used to shy away from code that contained this kind of black magic. However, unions are actually very cool things and are really not that scary or weird. A union is basically a variable. But instead of being an int, or a float, or a double, […]