c++ free delete 析构函数
free 不能调用析构函数
delete 才能调用析构函数
#include <climits>
#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
class A {
public:
A(){};
A(int n):_n(n){};
~A(){cout<<"xi"<<endl;};
int _n;
};
int main() {
A* a = new A(2);
// free(a);
delete(a);
return 0;
}