上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页
摘要: 1 #include <iostream> 2 using namespace std; 3 4 void swap( 5 int* &a,int* &b 6 ) 7 { 8 int * tmp = a; 9 a = b; 10 b = tmp; 11 } 12 int main() 13 { 14 阅读全文
posted @ 2022-09-13 22:19 balabalahhh 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 using namespace std; 3 class A 4 { 5 public: 6 int x; 7 int getX() { return x; } 8 }; 9 void swap( 10 A& a,A& b 11 ) 12 { 13 i 阅读全文
posted @ 2022-09-13 22:18 balabalahhh 阅读(23) 评论(0) 推荐(0) 编辑
摘要: multiset和set区别在于 前者可包含重复元素 1.创建一个set变量set2 用来记录进入过整数集的整数(利用唯一性),multiset变量mset用来管理整数集的所有整数(可包括重复的) 1 #include <iostream> 2 #include <set> 3 #include < 阅读全文
posted @ 2022-09-13 10:29 balabalahhh 阅读(13) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/hhhhxxn/article/details/106059028 图片也是网上找的 阅读全文
posted @ 2022-09-10 19:44 balabalahhh 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 using namespace std; 3 4 5 template <class T> 6 struct GoodCopy { 7 // 在此处补充你的代码 8 void operator()(T* p,T* q,T* r){ 9 int n = 阅读全文
posted @ 2022-09-10 17:17 balabalahhh 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 知识点1:static静态变量在类内声明,但必须在类外初始化 知识点2:构造函数不能是虚函数 为什么C++的构造函数不可以是虚函数,而析构函数可以是虚函数 - 知乎 (zhihu.com) 知识点3:如果基类构造函数里所有参数有缺省值,那么派生类函数可以不为其初始化,基类会自行用缺省值初始化变量 知 阅读全文
posted @ 2022-09-01 18:32 balabalahhh 阅读(41) 评论(0) 推荐(0) 编辑
摘要: (21条消息) 023:Fun和Do_Simon_Paul的博客-CSDN博客 1 #include <iostream> 2 using namespace std; 3 class A { 4 private: 5 int nVal; 6 public: 7 void Fun() 8 { cou 阅读全文
posted @ 2022-08-30 15:00 balabalahhh 阅读(30) 评论(0) 推荐(0) 编辑
摘要: (21条消息) C++面向对象程序设计 020:继承自string的MyString (北大Mooc)(含注释)_Love 6的博客-CSDN博客 1 #include <cstdlib> 2 #include <iostream> 3 #include <string> 4 #include <a 阅读全文
posted @ 2022-08-28 16:59 balabalahhh 阅读(55) 评论(0) 推荐(0) 编辑
摘要: (21条消息) C++编程练习 013:魔兽世界之一:备战_德林恩宝的博客-CSDN博客 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 #define WARRIOR_N 阅读全文
posted @ 2022-08-20 22:18 balabalahhh 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 using namespace std; 3 class A { 4 public: 5 int val; 6 A(int n = 123):val(n){} 7 A& GetObj(){return *this;} 8 }; 9 int main() 阅读全文
posted @ 2022-08-19 15:04 balabalahhh 阅读(26) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页