Skip to content

{ Category Archives } C

C Tip: Memory Management Macros

One of the things I enjoy about C in comparison to C++ is its simplicity. You rarely have to worry about what’s going on behind the scenes — the compiler isn’t going to play any dirty tricks on you with copy constructors or memory layouts. It’s pretty much a what-you-code-is-what-you-get situation. Even memory management is […]

C Tip: Safe String Manipulation

C-style strings are considered evil by hardcore C++ programmers. They love to talk down on those of us who still use such unsafe and archaic techniques. I can’t count the number of times I’ve seen someone ask for help with a C problem at a game development forum only to be flamed and lectured for […]

C Tip: Forward Declaring Structs

Forward declarations in C allow you to declare an object type before actually defining it (you can also do this in C++, but the process is not exactly the same - this tip focuses on C). The most common use of this technique in C is to declare pointers to a type to be used […]