![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
cpp
hehern
无人驾驶小白
展开
-
vector push_back普通指针的感想
vector push_back普通指针的感想 #include <vector> #include <iostream> //vector push_back是变量内容的拷贝,而且是深拷贝,对于数据来说,变量中存储的内容就是变量值。对于指针来说,变量内存储的内容是指针指向的内存地址, /*1 2 3 4 5 5 5 5 1 2 3 4*/ void test1() { std::vector<int> vec; int num1 = 1; in原创 2021-03-13 15:57:29 · 1622 阅读 · 0 评论 -
C++举例说明拷贝构造函数与赋值运算符重载函数
#include <iostream> using namespace std; class test{ public: test(){ cout << "constructor" << endl; } test(const test& a) { cout << "copy constructor" << endl; } ~test(){} t原创 2020-08-25 17:05:24 · 126 阅读 · 0 评论