形成内存泄露的几种缘由 C++

先考虑一种状况,对一个已知对象进行拷贝,编译系统会自动调用一种构造函数——拷贝构造函数,若是用户未定义拷贝构造函数,则会调用默认拷贝构造函数。html //main.cpp #include <iostream> #include "student.h" int main() { Student s1; Student s2(s1);//Student s2
相关文章
相关标签/搜索