当前位置:网站首页>Constructor & destructor
Constructor & destructor
2022-04-23 22:05:00 【Scarcity risk humility】
The constructor of a class is a special member function of a class , It will be every time When a new object of a class is created .
The name of the constructor and the name of the class are Exactly the same Of , And no type is returned , And will not return void. Constructors can be used to set initial values for certain member variables .
The destructor of a class is a special member function of a class , It will be every time Execute when deleting the created object .
The name of the destructor and the name of the class are Exactly the same Of , Just add a word in front of it ** The waves, (~)** As a prefix , It doesn't return any value , It can't take any parameters . Destructors help in jumping out of programs ( For example, closing files 、 Free up memory, etc ) Release resources before .
版权声明
本文为[Scarcity risk humility]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/113/202204232201249916.html
边栏推荐
- OpenFeign的细节展示
- [leetcode refers to offer 22. The penultimate node in the linked list (simple)]
- Database Experiment 7 stored procedure experiment
- RestTemplate 服务调用
- C list data paging
- [leetcode sword finger offer 58 - I. flip word order (simple)]
- static关键字及应用
- Pytorch installation (personal records)
- C reads excel specific data into specific columns of DataGridView
- MySQL 回表
猜你喜欢
Hystrix断路器开启条件和流程以及默认备选处理
Vscode may not establish connection to "XXX"
[leetcode refers to the maximum profit of offer 63. Stock (medium)]
Resolve the "chromedriver executable needs to be in path" error
DW basic tutorial (I)
Database Experiment 8 trigger experiment
Handling of alternative solutions for openfeign integration with hystrix
NVM introduction, NVM download, installation and use (node version management)
不同注册中心区别
A method of asynchronous response of application service through load balancing
随机推荐
hystrix dashboard的使用
轻量化项目管理思路
五个拿来就能用的炫酷登录页面
MySQL back to table
服务雪崩效应
ERP function_ Financial management_ Basic concepts of Finance
OpenFeign的参数传递之数组和集合类型
C# ftpHelper
[leetcode refers to offer 18. Delete the node of the linked list (simple)]
[leetcode refers to offer 47. Maximum value of gift (medium)]
LabVIEW设置应用程序显示标签透明
LabVIEW采集鼠标、键盘数据
Colon function and explicit keyword in constructor
Leaf Smecta
成员函数和非成员函数
Lightweight project management ideas
[leetcode refers to offer 21. Adjust the array order so that odd numbers precede even numbers (simple)]
Correction of date conversion format error after Oracle adds a row total
LabVIEW显示控件中内容过长设置自动滚动条
Download, install and configure Huawei integrated development environment ide deveco device tool