Category Archives: Uncategorized

Star Catalog 1.0

This post covers the first part of a project to develop a star catalog in C. The aims of this initial stage are quite modest - we will write a program to import star data from a file into a … Continue reading
Posted in Uncategorized | Leave a comment

Pascal’s Triangle

The numbers in the graphic below form the first five rows of Pascal's Triangle. The first row consists of a single number 1. In subsequent rows, each of which is has one more number than the previous, values are calculated … Continue reading
Posted in Uncategorized | Leave a comment

Object-Oriented Programming in C

C is not, of course, an object oriented language and does not even have any discernible features of one. The three core characteristics of object oriented programming are frequently stated to be encapsulation, inheritance and polymorphism, but a more fundamental … Continue reading

Posted in Uncategorized | 3 Comments

The Soundex Algorithm

Soundex is one of a number of phonetic algorithms, assigning values to words or names so that they can be compared for similarity of pronounciation. It is probably the best know such algorithm as it is built in to most … Continue reading

Posted in Uncategorized | Leave a comment

Creating a Static Library

In a number of previous posts I have used more than one source code file, one for the main function and others for functions used by main. This is purely to make the source code easier to handle than would … Continue reading

Posted in Uncategorized | Leave a comment

On Success and On Error Callbacks

This is a short post to demonstrate the use in C of a technique which is common in other languages – using callbacks as function parameters to tell the function what to do in certain circumstances. In this project I … Continue reading

Posted in Uncategorized | Leave a comment

Normal Distribution

One of the most useful bits of number-crunching you can do with data is to calculate the probability distribution, in the earnest hope that it will be a reasonable fit for one of the recognised distributions such as the normal … Continue reading
Posted in Uncategorized | Leave a comment

Calculating Great Circle Distances

The shortest distance between two locations on the surface of Earth (or any planet) is known as the Great Circle Distance. Except for relatively short distances these cannot be measured on a map due to the distortion and flattening necessary … Continue reading
Posted in Uncategorized | Leave a comment

Graphing Data Using a Logarithmic Plot

The majority of data can easily be plotted on a graph with equal intervals on the axes, for example 1, 2, 3 or 100, 200, 300 etc.. Some data, typically that which increases or decreases exponentially, cannot comfortably be graphed … Continue reading
Posted in Uncategorized | Leave a comment

Now on Github

A very quick micro-post just to say that I have pushed the source code for all my posts to date to Github. The URL is https://github.com/code-in-c The source code for all future posts will also be on Github so feel … Continue reading

Posted in Uncategorized | Leave a comment