Tuesday, August 12, 2003

Programming quiz #2 What's wrong with this constructor?
class Buggy : public Base
{
private:
    Object mymember;
public:
    Buggy() : Base(&mymember)
    {
    }
};
Today, a change I made to a base class constructor exposed a bug like this in a derived class. Why is the above constructor just begging for a SIGSEGV?

No comments: