用visual studio运行发现是有错误的,就更懵了.现在是连每一步什么目的,用到了什么也不清楚,请求好心人讲解一下啦~~多多谢谢~~
#include<iostream>
using namespace std;
class point {
public:
static int number;
public:
point(){number++;
~point(){number-;}
};
imt point::number=0;
void main(){
point*ptr;
printA,B;
{
point*ptr_point=new point{3};
ptr=ptr_point;
}
pointC;
cout<<point::number<<endl;
delete[]ptr;
}
运行时输出的结果是
A)3 B)4 C)6 D)7