C++编程练习
czopg
不懈进取,永无止境!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
信息系统框架集成第三方产品案例
1 数据的发送和接收 报文协议 CSocketProtocol.h #pragma once //定义报文协议类,纯虚函数作为面向抽象类(接口)编程 class CSocketProtocol { public: //报文的初始化、发送、接收、销毁函数,返回值为0则函数正常运行 virtual int cltSocketInit() = 0; virtual int cltSocke...原创 2019-05-03 13:25:58 · 527 阅读 · 0 评论 -
数组模板类MyVector
类模板练习:可以管理基本数据类型,类元素,类指针 定义类模板 MyVector.h #pragma once #include <iostream> using namespace std; //先考虑类型int char template <typename T> class MyVector { friend ostream& operator<...原创 2019-05-03 23:55:52 · 1566 阅读 · 0 评论 -
STL容器运用练习
string #include <iostream> #include <string> #include <algorithm> using namespace std; //1 初始化 void test01() { string s1 = "aaaaaa"; string s2("bbbbbb"); string s3 = s2; string...原创 2019-05-05 20:26:44 · 427 阅读 · 0 评论 -
预定义函数对象和函数适配器
STL常用算法练习 #include <iostream> #include <algorithm> #include <functional> #include <vector> #include <list> #include <iomanip> #include <iterator> //包含ostre...原创 2019-05-05 20:39:16 · 242 阅读 · 0 评论 -
STL综合案例 学校演讲比赛
学校演讲比赛案例: 1)某市举行一场演讲比赛,共有24个人参加,按参加顺序设置参赛号。比赛共三轮,前两轮为淘汰赛,第三轮为决赛。 2)比赛方式:分组比赛 第一轮分为4个小组,根据参赛号顺序依次划分,比如100-105为一组,106-111为第二组,依次类推,每组6个人,每人分别按抽签(draw)顺序演讲。当小组演讲完后,淘汰组内排名最后的三个选手,然后继续下一个小组的比赛。 ...原创 2019-05-05 20:45:47 · 579 阅读 · 0 评论 -
算法中的函数对象和谓词
函数对象 谓词 //算法中的函数对象和谓词 //for_each find_if transform sort #include <iostream> #include <algorithm> //#include <functional> #include <vector> #include <string> #inc...原创 2019-04-30 12:24:55 · 398 阅读 · 0 评论 -
循环链表实现与约瑟夫问题
循环链表API函数头文件 circlelist.h #pragma once typedef void CircleList; typedef struct _tag_CircleListNode { struct _tag_CircleListNode* next; }CircleListNode; CircleList* CircleList_Create(); void Ci...原创 2019-05-06 09:48:43 · 319 阅读 · 0 评论
分享