Archive for the 'Uncategorized' Category

29
Jul
14

UnitC++

This post is an introduction to a library I have written, UnitC++.

UnitC++ is a modern, light weight, header-only c++ library for making unit testing easy. The intention of this library is to make it really easy to test c++ code in a portable way.

 

Continue reading ‘UnitC++’

29
Apr
13

Unusual C++ use of #include

Muhamad Hesham's T-Blog

"The

The usual use is to write it at the very top of your .h/.cpp files to include other header files like (Windows.h, iostream, cstdio, etc..) to use the what is defined inside in your .h/.cpp file.

The unusual use is to use it to initialize a data-structure like arrays by including a text file that contains the array initialization data between the array initializer list parentheses – e.g XX XXX[] = { <HERE> }. This is is illustrated in the sample program below. The same concept can be used to initialize an array of any dimension.

// main.cpp
#include <cstdio>
#include <Windows.h>

struct Person
{
    char        *pName;
    unsigned    Age;
    unsigned    Height;
    char        Gender;
};

// Declare and initialize a 1D array of Persons structs using PersonTableData text file
// #include "PersonsTableData" will be expanded at COMPILE TIME to the content of PersonsTableData file
Person PersonsTable[] = {
    #include "PersonsTableData"

View original post 73 more words

07
Jun
12

Hello World!

WordPress has helpfully given me the perfect title for my first post here (click if you don’t know why). This is going to be a blog about all things code and related topics such as operating systems and cool hardware. (Especially as I am the recent owner of a Raspberry Pi)

At the moment I don’t have much on here, but if anyone does actually read this there will be more coming soon!