上一页 1 2 3 4 5 6 7 ··· 18 下一页
摘要: void checkTarget() { int target = 14; int buf[] = { 8, 2, 9, 10, 5, 4, 6 }; std::map<int, int> tmpMap; for (int i = 0; i < sizeof(buf); i ++) { std::m 阅读全文
posted @ 2021-04-06 08:34 唯一诺 阅读(118) 评论(0) 推荐(0)
摘要: class CSub2 { public: CSub2() { cout << "默认构造函数:" << this <<endl; } CSub2(int x) : m_x(x) { cout << "构造函数:" << m_x << ":" << this << endl; } CSub2& op 阅读全文
posted @ 2021-03-31 21:03 唯一诺 阅读(416) 评论(0) 推荐(0)
摘要: https://blog.csdn.net/wudishine/article/details/12307611 阅读全文
posted @ 2021-03-31 19:19 唯一诺 阅读(196) 评论(0) 推荐(0)
摘要: 11 阅读全文
posted @ 2021-03-30 20:13 唯一诺 阅读(51) 评论(0) 推荐(0)
摘要: template<typename T> void funcTmp(T a, T b) { cout << "this is yiban" << endl; } template<> void funcTmp(const char* a, const char* b) { cout << "this 阅读全文
posted @ 2021-03-30 19:27 唯一诺 阅读(59) 评论(0) 推荐(0)
摘要: 1. 必须使用初始化列表初始化一个引用成员; class CBase { public: CBase(int a) : m_a(a) //正确,m_a是一个变量的引用,必须通过初始化列表初始化 { // m_a = a; //错误 cout << "m_a:" << m_a << endl; } p 阅读全文
posted @ 2021-03-30 19:24 唯一诺 阅读(1861) 评论(0) 推荐(0)
摘要: https://chenqx.github.io/2014/09/25/Cpp-Memory-Management/ 阅读全文
posted @ 2021-03-29 08:54 唯一诺 阅读(51) 评论(0) 推荐(0)
摘要: 1. static_cast用法:static_cast < type-id > ( exdivssion ) 该运算符把exdivssion转换为type-id类型,但没有运行时类型检查来保证转换的安全性。它主要有如下几种用法:① 用于类层次结构中基类和子类之间指针或引用的转换。 进行上行转换(把 阅读全文
posted @ 2021-03-27 10:54 唯一诺 阅读(124) 评论(0) 推荐(0)
摘要: 什么是顶层和底层const: 1. 顶层const:指const定义的变量本身是一个常量; 2. 底层const:指const定义的变量所指向的对象是一个常量; const int i = 0; //顶层const,变量i就是常量; const int * a = &i; //底层const, a所 阅读全文
posted @ 2021-03-26 08:57 唯一诺 阅读(462) 评论(0) 推荐(1)
摘要: class tmp { public: int a; int b; }; class ctest { public: ctest() { p = new tmp; } ~ctest() { delete p; } ctest& operator = (const ctest& t) { tmp * 阅读全文
posted @ 2021-03-25 20:26 唯一诺 阅读(104) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 18 下一页