#include<iostream> using namespace std; class Human { private: int i; public: Human(){cout<<"构造函数执行中..."<<endl; i=999;} ~Human(){cout<<"析构函数执行中..."<<endl;} int get() const{return i;} };
int main() {
Human Jack; cout<<Jack.get()<<endl;
Human *p=new Human; cout<<(*p).get()<<endl; cout<<p->get()<<endl;