上一页 1 2 3 4 5 6 7 8 ··· 24 下一页
摘要: #include <iostream> #include <vector> #include <chrono> #include <windows.h> using namespace std; using namespace std::chrono; // 要考虑 copy ctor 和 copy 阅读全文
posted @ 2019-12-12 22:09 路边的十元钱硬币 阅读(389) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <vector> using namespace std; int main() { // 初始化的方式 std::vector<int> vec1; //std::vector<int> vec2(1750000);// 7G std::v 阅读全文
posted @ 2019-12-11 22:30 路边的十元钱硬币 阅读(5568) 评论(0) 推荐(0) 编辑
摘要: #include // operator Type() 类型操作符重载 // operator int() // operator double() // ... ////////////////////////////////////////////////////////// class Rectangle { public: #ifdef Want_compiler_to_add_... 阅读全文
posted @ 2019-12-02 19:33 路边的十元钱硬币 阅读(239) 评论(0) 推荐(0) 编辑
摘要: #include // operator Type() 类型操作符重载 // operator int() // operator double() // ... ////////////////////////////////////////////////////////// class Rectangle { public: Rectangle(const int w, cons... 阅读全文
posted @ 2019-12-02 19:22 路边的十元钱硬币 阅读(744) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> // 可变模板参数 // 此例:可以构造可变数量,可变类型的函数输入。 // 摘自:https://www.cnblogs.com/qicosmos/p/4325949.html ///////////////////////////// using namespace std; //递归终止函数 void print() { cout << "empty" 阅读全文
posted @ 2019-12-01 21:21 路边的十元钱硬币 阅读(576) 评论(0) 推荐(0) 编辑
摘要: #include // 可变模板参数 // 此例:可以构造可变数量,可变类型的函数输入。 // 摘自:https://www.cnblogs.com/qicosmos/p/4325949.html ///////////////////////////// using namespace std; //递归终止函数 void print() { cout void print(T h... 阅读全文
posted @ 2019-12-01 21:16 路边的十元钱硬币 阅读(839) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> // overloading "operator >> " outside class // >> 应该定义在类之外。 ////////////////////////////////////////////////////////// class Rectangle { public: Rectangle(int w, int h) : width(w), 阅读全文
posted @ 2019-12-01 16:27 路边的十元钱硬币 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 虚函数的几点说明: 1. 当一个成员函数定义为虚函数时,其派生类中的同名函数也自动为虚函数。无论其是否添加了 virtual 关键字。 为了能良好的阅读代码,请加上。 2. 父类的虚函数,就是为了让子类中的同名成员函数覆盖。这样,父类对象的指针就可以指向子类对象,并调用子类的同名函数。 3. 纯虚函 阅读全文
posted @ 2019-12-01 15:42 路边的十元钱硬币 阅读(225) 评论(0) 推荐(0) 编辑
摘要: Stack 堆 存在于某作用域内的一块空间。说白了就是函数产生的空间,用于存放函数的变量、返回地址。 在函数体中声明的局部变量,就时存储在Stack中。 Heap 栈 由操作系统提供的全局空间。在程序结束后由系统释放。 定义的全局变量就在这个内存区域中。 静态数据区 static对象所在区域。 文字 阅读全文
posted @ 2019-12-01 15:27 路边的十元钱硬币 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 类中含有 指针类型 的成员变量时,就必须要定义 copy ctor 和 copy op= copy ctor 请见: copy op= 请见: https://www.cnblogs.com/alexYuin/p/11965172.html 阅读全文
posted @ 2019-12-01 15:13 路边的十元钱硬币 阅读(326) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 24 下一页