34 lines
453 B
C++
34 lines
453 B
C++
/*
|
|
* Code: Cplus学习
|
|
* Date: 2024-04-19
|
|
* Design by JRNitre
|
|
*
|
|
* Function:
|
|
* * 构造函数
|
|
* * 析构函数
|
|
* */
|
|
|
|
#include <iostream>
|
|
using namespace std;
|
|
|
|
class person{
|
|
public:
|
|
// 构造函数 - 无参
|
|
person(){
|
|
cout << "no parameter structure function" << endl;
|
|
}
|
|
|
|
// 析构函数 - 无参
|
|
~person(){
|
|
cout << "no parameter destructors function" << endl;
|
|
}
|
|
|
|
};
|
|
|
|
int main() {
|
|
person p1;
|
|
|
|
system("pause");
|
|
return 0;
|
|
}
|