2021年10月6日

摘要: 折半查找 int arr[] = { 23, 37, 41, 55, 64, 75, 83, 99, 101 }; int t; cin >> t; int low = 0, high = sizeof(arr) / sizeof(arr[0]); int mid = 0; while (low < 阅读全文
posted @ 2021-10-06 21:53 祁东 阅读(5) 评论(0) 推荐(0) 编辑
 
摘要: =default&=delete class Foo { public: Foo(int i) :_i(i) { cout << "Foo(int i)\n"; } Foo() = default; //可以跟上一个构造函数并存(构造函数可以多个并存) Foo(const Foo& x) :_i(x 阅读全文
posted @ 2021-10-06 10:51 祁东 阅读(16) 评论(0) 推荐(0) 编辑
 
摘要: 构造函数可以有多个,但是拷贝构造函数只能有一个。 当类有指针成员时,必写Big-three函数 浅拷贝:拷贝指针四字节;深拷贝:拷贝指针四字节和指针指向的数据 define和const区别 - 菜鸟 define/typedef/using - 博客园 不能对Alias Template(化名)做偏 阅读全文
posted @ 2021-10-06 10:50 祁东 阅读(15) 评论(0) 推荐(0) 编辑