Category Archives: C Programming

Creating a Shared Library

I thought we could take a quick look at how to create a shared library out of our code. This week we’ll create the library and next week we’ll look at the various ways of installing/accessing it on the operating system. I’m going to re-use the palindrome program I’ve talked about before (a proper version, not the dodgy […]

A Challenge Discussion – Returning Pointers To Local Variables

Last week’s challenge was a tough one, so don’t be alarmed if you had no idea what the issue might have been. Also, it can be hard to spot problems in a functional program because you tend to concentrate on what the code is actually doing, rather than the validity of the code itself. To give […]

atoi and itoa

atoi and iota seem like perfect partners. atoi is the ‘ascii to integer’ function and itoa is the reverse, the ‘integer to ascii’ function. You would use atoi to convert a string, say, “23557” to the actual integer 23557. Similarly, you would use itoa to convert an integer, say 44711, to the equivalent string “44711”. […]

Fibonacci | Recursively or Not?

You’re probably all aware of the Fibonacci number sequence. Starting with 0 and 1, the next number is determined by the sum of the previous two numbers, so the sequence begins: 0, 1, 1, 2, 3, 5, 8, 13, 21, … This is a mathematical concept, and it is defined by a “recurrence relation” (that’s […]