Category Archives: C Programming

Inclusion Guards

Just to clear up what we’re talking about, an inclusion guard looks like this: #ifndef HEADER_FILE_H #define HEADER_FILE_H …//your header #endif //HEADER_FILE_H It consists of three preprocessor directives around the code of your header file. Most IDEs add these for you automatically when you create a header, but it’s well worth having an appreciation of why […]

Debug ncurses with GDB + GDBserver and Full Input Output

Actually, you can use this technique to debug any kind of console app where debugging on the command line interferes with the program’s output. It’s quick and easy, and unlike attaching to a running process in another shell, it allows you to debug as soon as the program starts, meaning you can catch even those fiddly bugs that only […]

What Does The Preprocessor Do?

What a jolly good question. The preprocessor takes a look at your source code just before it goes off to the compiler, does a little formatting, and carries out any instructions you have given it. Like what? Well, preprocessor instructions are called preprocessor directives, and they all start with a #. Like #include? Exactly. Each […]

Bitwise Operators – Free Guide

I have an exciting new eGuide available. Most of this info is available in various places on my site, but I’ve collated it all together in one document, and updated it, so it’s easier for you to use. What does it cover? It’s a no-jargon guide to the four bitwise operators in C (AND, OR, […]