My knowledge of C ++ arcana is a little rude. Let's say I have the following classes:
struct Bar {
int x;
};
class Foo {
Bar& bar;
public:
Bar* getRealAddress() { return &bar; }
Foo(Bar& _bar) : bar(_bar) {}
};
Bar bar1;
Foo foo1(bar1);
Will it foo1.getRealAddress()return the same value as &bar1?
source
share