cannot determine the size since it has one of the classes definition , right ?
class B;
class A{
public:
B* b;
A() { b = new B(); }
};
class B{
public:
A* b;
B() { b = new A(); }
};
it can. sizeof(A) is sizeof(a pointer) + some padding
You have only pointer it's just the address
Обсуждают сегодня