上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 32 下一页
  2021年8月8日
摘要: 1 //C++ 继承 2 //继承是面向对象三大特性之一 3 4 #include <iostream> 5 #include <string> 6 using namespace std; 7 8 //普通实现页面****************************************** 阅读全文
posted @ 2021-08-08 08:37 Bytezero! 阅读(30) 评论(0) 推荐(0) 编辑
  2021年8月7日
摘要: 1 //函数调用运算符重载 2 3 #include <iostream> 4 #include <string> 5 using namespace std; 6 7 //函数调用运算符重载 8 9 class MyPrint 10 { 11 public: 12 13 //重载函数调用运算符 1 阅读全文
posted @ 2021-08-07 17:45 Bytezero! 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 1 //关系运算符重载 < = > != 2 #include <iostream> 3 #include <string> 4 using namespace std; 5 6 7 //重载关系运算符 8 class Person 9 { 10 public: 11 Person(string n 阅读全文
posted @ 2021-08-07 17:17 Bytezero! 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1 //赋值运算符重载 = 2 #include <iostream> 3 #include <string> 4 using namespace std; 5 6 //赋值运算符的重载 7 class Person 8 { 9 public: 10 11 Person(int age) 12 { 阅读全文
posted @ 2021-08-07 16:59 Bytezero! 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <string> 3 using namespace std; 4 5 //重载递增运算符 6 7 //自定义整形 8 class MyInteger 9 { 10 friend ostream& operator<<(ostream 阅读全文
posted @ 2021-08-07 16:28 Bytezero! 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <string> 3 using namespace std; 4 5 class Person 6 { 7 friend ostream& operator<<(ostream& cout, Person& p); 8 public 阅读全文
posted @ 2021-08-07 14:34 Bytezero! 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <string> 3 using namespace std; 4 5 //1.成员函数重载 +号 6 class Person 7 { 8 public: 9 10 //Person operator+(Person& p) 11 阅读全文
posted @ 2021-08-07 14:33 Bytezero! 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 1 //友元 全局函数做友元 2 /* 3 #include <iostream> 4 #include <string> 5 using namespace std; 6 7 //建筑物类 8 class Building 9 { 10 11 //GoodGay全局函数 是 Building好朋友 阅读全文
posted @ 2021-08-07 11:32 Bytezero! 阅读(135) 评论(0) 推荐(0) 编辑
  2021年8月6日
摘要: 1 //this 指针的使用 2 //1 解决名称冲突 3 //2 返回对象本身 用 *this 4 5 #include <iostream> 6 #include <string> 7 using namespace std; 8 9 class Person 10 { 11 public: 1 阅读全文
posted @ 2021-08-06 19:52 Bytezero! 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 1 //深拷贝与浅拷贝 2 3 //浅拷贝 : 简单的赋值拷贝操作 4 //深拷贝: 在堆区重新申请空间 进行拷贝操作 5 6 7 #include <iostream> 8 using namespace std; 9 10 class Person 11 { 12 public: 13 Pers 阅读全文
posted @ 2021-08-06 15:31 Bytezero! 阅读(66) 评论(0) 推荐(0) 编辑
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 32 下一页