#include<iostream.h>
#include<iomanip.h>
class point
{
private:
int x;
static int count;
public:
point(int m)
{
x=m;
count++;
}
~point()
{
count--;
cout<<count<<endl;
}
void show()
{
cout<<x<<setw(8)<<count<<endl;
}
};
int point::count=0;
int main()
{
point p1(3);
p1.show();
point p2(6);
p2.show();
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载