mercredi 2 mars 2016

Pointer in class

I don't know why my code doesn't work. The problems are in a picture below.

class A
{
private:
    B* b;
public:
    friend class B;
};

class B
{
private:
    A *a;
public:
    friend class A;
    void h()
    {
        (a->b)->h();
    }
};

enter image description here

Aucun commentaire:

Enregistrer un commentaire