当前位置:网站首页>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
边栏推荐
- A series of problems of C DataGridView binding list
- LabVIEW modify the appearance of the application window
- IIS cannot load * woff,*. woff2,*. Solution of SVG file
- hystrix dashboard的使用
- Lightweight project management ideas
- Download, install and configure Huawei integrated development environment ide deveco device tool
- [leetcode refers to offer 10 - I. Fibonacci sequence (simple)]
- [leetcode sword finger offer 58 - I. flip word order (simple)]
- Ensuring the quality of living materials and food safety in Shanghai
- 2022 - 04 - 24 Daily: Current Progress and Open Challenges of Applied Deep Learning in Biological Sciences
猜你喜欢

Echerts add pie chart random color

Database Experiment 2 data query

MVC three-tier architecture (illustration)

JS merge duplicate data in array object

Openharmony get the source code

Easylaser laser shaft alignment instrument maintenance homocentric instrument maintenance E420

Subcontracting of wechat applet based on uni app

Pycharm Chinese plug-in

Idea import a project

轻量化项目管理思路
随机推荐
leetcode 2223 — 构造字符串的总得分和
Unity制作一个小星球
不同注册中心区别
五个拿来就能用的炫酷登录页面
修改服务的默认负载均衡策略
UML学习转载
Opening conditions and process of hystrix circuit breaker and default alternative treatment
Ribbon负载均衡策略
Oracle intercepts special characters
Pytorch deep learning practice (2)
成员函数和非成员函数
Implementation of service fusing
consul 关闭健康监控检查
OpenFeign 组件说明
OpenFeign的细节展示
DW basic course (II)
Database Experiment 5 Security Language Experiment
Pycharm download and installation
21. Basic usage of MariaDB
Introduction to tensorrt