The members of a class
are private by default. To make them accessible use keyword public
.
class X
{
public:
X() {}
~X() {}
// rest of the public stuff
private:
// private stuff
};
Inner class has full access to private members of outer class, not other way around.
Do not pay too much attention to what intellisense says; it is often helpful, but it is sometimes wrong. Compiler is written by better programmers of Microsoft so try if what you wrote compiles.