- 博客(3)
- 收藏
- 关注
原创 [C++面试]构造函数、析构函数调用顺序
构造函数、析构函数调用顺序基于https://blog.csdn.net/zhangkaihang/article/details/7542621改进。由于原文有错,对其进行修改并增加析构函数的相关测试。样例#include <iostream>#include <string>using namespace std;//抽象类Aclass A{public: A() { cout << "抽象类A的构造函数" << endl; }
2020-09-01 23:11:08 228
原创 [C++面试]i++与++i
i++与++i1. 样例#include <iostream>using namespace std;void printVal(int before, int after, int* intp) { cout << "before: " << before << endl; cout << "after: " << after << endl; cout << "in func
2020-09-01 19:40:47 177
原创 [C++面试]右值引用与移动构造
右值引用与移动构造类的定义#include <iostream>#include <utility>using namespace std;class C {public: C() { cout << "construction" << endl; } C(C ¶m) : val(new int(*param.val)) { cout << "copy c
2020-09-01 19:27:50 236
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人