N
newbiecpp
Why this code cannot be compiled (under VC++ 7.0):
class Outer {
public:
class Inner {
public:
Inner() : in_data(0) {}
void action()
{
Outer:ut_data++; // illegal reference to non-static
member 'Outer:ut_data'
}
int in_data;
};
Outer() : out_data(0) {}
void action()
{
Inner::in_data++; // ittlegal reference to non-static member
'Outer::Inner::in_data'
}
int out_data;
};
Thanks in advance!
class Outer {
public:
class Inner {
public:
Inner() : in_data(0) {}
void action()
{
Outer:ut_data++; // illegal reference to non-static
member 'Outer:ut_data'
}
int in_data;
};
Outer() : out_data(0) {}
void action()
{
Inner::in_data++; // ittlegal reference to non-static member
'Outer::Inner::in_data'
}
int out_data;
};
Thanks in advance!