Category Archives: C++ Programming

Virtual Destructors

Interview questions often ask about virtual destructors and why they are needed. It’s one of those funny things about C++ that unless you have specifically been shown, you just might not realise you need to know. So why do you need a virtual destructor? Essentially, you need a virtual destructor to make sure that ALL […]

C++ Eclipse Masterclass Now Open!

It’s HERE! This morning at 9am GMT the C++ Eclipse Masterclass opened for enrolment. Hurrah! I have poured my heart and soul into creating this course, and I am so proud to finally be launching it today. It opens with an early bird discount which runs until midnight GMT on 1st June, so if you […]

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 […]