If I have this
how can I make sure it compiles. Also if I have this
const HermitCrab* t = &b;
are these answers right
const HermitCrab b(3);
Will Compile Code…
____________ 1 HermitCrab* const q = &a;
____________ 2 const HermitCrab* p = &a;
____________ 3 HermitCrab* const m = &b;
____________ 4 const HermitCrab* r = &b;
____________ 5 const HermitCrab* p = &b;
p = &a;
1) No because the pointer is read only
3) No because the object is constant therefore it most have a const object pointer
>how can I make sure it compiles.
Hmm, define HermitCrab with a GetShellSize member function and define b to be an object of type HermitCrab.
>1) No because the pointer is read only
And what does that have to do with calling a member function on the pointed to object?
Erm, it takes what - 30 seconds to actually type that into a small program and see if you get any 'you can't do that it's const' type error messages.