I am reading "C++ : The Complete Reference 4th Edition"
The author says ( pg 292 ) :
"No member can be an object of the class that is
being declared. (Although a member can be a pointer to the class that is being
declared.)"
Through a code I gathered He meant something like :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
class abc
{
public:abc *p1; // ??
//abc a2; not allowed
};
int main()
{
abc a1;
cout<<a1.p1<<endl;
cout<<&a1;
}
But then, What is pointer to a class ? Pointer to an object of a class makes sense.
If pointer to a class means pointer to an object of the class then
shouldn't the result of "a1.p1" and "&a1" be same ?