Quickie: Configuration Headers

We all know (or at least we should know) that we can use #define to create macros that replace names with values during the preprocessor phase of compilation. Sometimes, it's very important for us to have the ability to change large amounts of code very quickly, because we have a new size limit for

Patterns: Shielding Inputs with const

One of the key worries I have heard from those ill-informed OOP programmers is that C cannot protect inputs you pass into functions. They use private fields and retrieval functions to ensure that the stored value is protected from unwanted modification. However, this concern is addressed by C's const keyword. Taking a const value There are times

Linux + C – Make

Compiling your program is easy when you're working with one source and the standard libraries, but it gets more complex as you go along. That's why God put make on this earth. The First Makefile ...was created alongside the Earth. Every other makefile is derived from a previous one. Jokes aside, the make program reads a makefile

Linux and C – “Hello, world!”

Since the release of K&R, every programmer has become familiar with the Hello, world! program. I find that learning to build this program from start to finish is an excellent introduction to the tools available in Linux. Setup First, we want to create a directory for our programs. I recommend ~/Documents/Programming, because this is a simple

CS 101 – Life Cycle of a Program

Programs go through a variety of stages on the way to execution. Depending on the type of language, some steps may be added or removed to the list, but here are the stages for a compiled language like C. Problem All programs start with a problem which needs to be solved. This problem could be as