标签:main fine end ret int return bsp stream ber
#include<iostream> using namespace std; /* start of Enclosing class declaration */ class Enclosing { private: int x; /* start of Nested class declaration */ class Nested { public: int y; void NestedFun(Enclosing *e) { cout<<e->x; // works fine: nested class can access // private members of Enclosing class } }; // declaration Nested class ends here public: int access_nested(){ Nested nested; cout<<nested.y<<endl; return 0; } }; // declaration Enclosing class ends here int main() { Enclosing enclosing_instance; enclosing_instance.access_nested(); }
标签:main fine end ret int return bsp stream ber
原文地址:https://www.cnblogs.com/youge-OneSQL/p/9639748.html