cplusplus.co.il

Archive for September 2009

This post continues and explains the previous erroneous post.

In the example from the previous post, our base class has invoked a virtual function during the construction of the object, expecting that the correct function would be called. Why was that an error, you ask ?
Read the rest of this entry »

Advertisements

Okay, so here’s how this category is going to work. I will post and explain a few lines of code, with one (or more) defect(s) hidden in them. The defect will not be trivial (at least not intentionally). Your job is to spot and explain the bug(s) – once there’s at least one comment about what i was aiming for, I will update the post with an explanation.

Find below the first post, on the topic of file signatures (aka magic numbers).

Read the rest of this entry »

I’ll assume you are already familiar with the concept of namespaces, and the using keyword. So let me try and introduce some of the less common features of the namespace mechanism.

Read the rest of this entry »

This article will discuss references to temporary objects – a mechanism with a few subtleties.

Read the rest of this entry »

When we approach the process of designing our software, there are many issues we must address in order to be succesful. One of these issues (and you are free to disagree) is: How will we be able to test (or debug) our hand crafted piece of code?

This post will attempt to at least provide one way of writing code that is a little easier to debug and test, by making use of the factory design pattern.

Read the rest of this entry »

I am a little busy nowadays, so excuse me for posting yet another somehow basic article. However, I still retain the hope that some of you are not familiar enough with at least one of these two keywords in C++.

Read the rest of this entry »

As promised, this article continues and provides a thorough explanation of the previous post.

Read the rest of this entry »