Back
Close

C++11 Nested

Anonymous
1,215 views

int x,y; // globals
class enclose { //
private:
int x; //
protected:
int xx;
public:
int xxx;
private:
static int s;
public:
private:
struct inner { //
void f(int i) {
//x = i; // enclose::x
//xx = i;
//xxx = i;
int a = sizeof x; // C++11
// C++11 OK sizeof
// enclose::x 使
s = i; // OK enclose::s
::x = i; // OK x
y = i; // OK y
}
void g(enclose* p, int i) {
p->x = i; // OK enclose::x
p->xx = i;
p->xxx = i;
}
};
};
int main()
{
return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants