C++ Templates Made Easy

Templates.

Groan.

With their godawful syntax and impressive verbosity it’s no wonder we screw our faces up in distaste when we see them in code. ESPECIALLY when we’re debugging that code. Oh my. It’s enough to make you wish you were writing the software for musical birthday cards instead (does anyone actually do that?).

Anyway, I’ve wanted to talk about templates for a long time but the approach is a tricky one because even hearing the dreaded ‘T’ word is enough to make people run for the hills. I probably should have put that in angle brackets. The dreaded <T> word. Ha ha.

Anyway, here we go, let’s dive in together because there is safety in numbers.

Templates – made easy. I promise 🙂

Read more

10 Years of FayeWilliams.com

10 years ago today, I registered this domain name.

Ten years!!!

Ten years is a big milestone, so I thought I’d take a trip down memory lane.

2005

I registered this domain on 4th February 2005 when I was living in San Jose, California.

I still can’t believe I was lucky enough to get it – even way back then it was hard to get the ultimate in web real estate – a dot com of your first and last name.

Read more

Static Variables In C And C++ – Function Level

We’ve looked at file level static variables, so now let’s see what happens when you put them in a function.

If you declare a static variable at function level (i.e. inside an normal function, not a class method), then you are creating a variable that will:

a) be instantiated the first time the function is actually called, and
b) retain its value after the function exits.

The variable is only accessible inside the function it is declared in.

Read more

Getting Started With C Programming – Hello World Tutorial

If you’ve always wanted to dabble in C, but never quite gotten around to it, have a read through this and give it a go.

It is much easier than you might think (easier now, in fact, than it ever has been), to write your first C program, and there is something so deliciously inviting about the language that once you get started you’ll soon be solving world issues with your code.

To follow along with me:

You will need

  1. A computer running a Linux variant (I use Fedora)
  2. A compiler
  3. This walkthrough

Read more