Function pointers are very handy in C++. But they don’t work on class methods, here is a neat workaround, that even works with virtual methods.
» more

What is your favorite IDE/Editor for coding C++? Well, it seems like some programmers prefer Paint over Visual Studio: » more

The Bresenham line algorithm avoids trigonometry and uses integer math to calculate the points of a line, circle or ellipse. » more

Sometimes it is useful if you are able to access fields of a struct or class as an array. » more

If you have functions with lots of parameters you should consider using a struct or class and pass the parameters by reference. » more

Sometimes it could be very useful to be able to test private members or methods in your unit tests. But how could this be achieved? » more

I lately talked with a friend about which language is the best and he told me that C++ doesn’t have Interfaces like Java. » more

Hack of the day: Safe delete
February 3, 2011

If you free up memory in C++, you should also set the pointer to NULL. If you double delete memory, your application will crash! » more

Hack of the day: Random sort
February 2, 2011

@dennisosimon and myself are currently prototyping various things using haxe.

Today we wanted to shuffle the elements of an array around. As haxe doesn’t support a shuffle-method for arrays out of the box, we came up with a very simple workaround: » more

As mentioned in one of my previous articles, a programmer should often use asserts to detect errors and bugs early. The problem with assertions is, that if you run your code, and the lines are not executed you’ll never get noticed about the problem. » more