01_局部类.cpp
#include<iostream>
using namespace std;
//局部类是指在一个函数内部定义的类
int get()
{
int m=100;
class A{
public:
A(){/*cout<<m<<endl;*/}
~A(){}
};
A a;
return m;
}
class A{
public:
A(){/*cout<<m<<endl;*/}
~A(){}
};
//err:
A l;
int main()
{
get();
}