类 总结
#include <iostream>
using namespace std;
class Outer
{
public:
class Inner
{
public:
void Fun();
///*{
// cout << "Inner::Fun..." << endl;
//}*/
};
public:
Inner obj_;
void Fun()
{
cout << "Outer::Fun..." << endl;
obj_.Fun();
}
};
void Outer::Inner::Fun()
{
cout << "Inner::Fun..." << endl;
}
int Fun()
{
class localClass
{
public:
int num_;
void Init(int num)
{
num_= num;
}
void Display()
{
cout << "num=" << num_<< endl;
}
};
localClass lc;
lc.Init(10);
lc.Display();
return 0;
}
int main()
{
Outer o;
o.Fun();
Outer::Inner i;
i.Fun();
Fun();
return 0;
}