- 博客(7)
- 收藏
- 关注
原创 7种常见排序算法-冒泡与选择
0x00 冒泡排序#include <stdio.h> void Msort(int * arr, int size) { int i, j, temp; for(i = 0 ; i < size - 1; ++i){ for(j = i + 1 ; j < size; j++){ if(arr[i] < arr[j]){
2017-01-21 20:15:41
201
原创 设计模式-单例模式
0x00 单例模式之懒汉式#include <iostream>using namespace std;class Singelton { private: Singelton(){ cout << "构造函数执行!" << endl; } public: static Singelton * Instance() { if(m_ps
2017-01-15 18:46:44
229
原创 libevent 之 hello world
0x00 基于 libevent 的 hello world 今晚刚看了一下 libevent 的示例代码,简洁记录一下自己对这份 hello world 代码的理解 这份代码是在 ubuntu 16.04 里编译生成, 下面用 netcat 测试#include <string.h> #include <errno.h> #include <stdio.h> #include <signal.h>
2017-01-12 22:43:24
463
原创 libevent 基础学习
0x00 在ubuntu 26.04中简单学习 libevent 小弟也是小白一枚,写的不好请忽见怪 #include <event2/event.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> /
2017-01-09 22:42:06
231
原创 设计模式-工厂模式
#include <iostream>using namespace std;//创建水果类 class Fruit { public: virtual void sayname() = 0; };class Banana : public Fruit { public: virtual void sayname(){ cout << "i'm Banana!" <<
2017-01-09 20:18:15
177
原创 设计模式-简单工厂模式
0x00 记一下简单工厂模式#include <stdio.h> #include <string.h> class Fruit { public: //创建一个纯虚函数,作为基类成员函数 virtual void GetFruit() = 0; };//创建一个 Banana 类, 公共继承于 Fruit 类 class Banana : public Fruit { public
2017-01-05 21:00:43
272
原创 在 DIALOG里定义工具栏消息
在 DIALOG里定义工具栏消息 小弟也只是初学MFC, 参考别人源码看不懂所记下 记录一下自己被困扰许久的问题 这也是自己第一篇博客,写得不好请多包含 在 DIALOG里定义工具栏消息 0x00 被困扰的消息 0x01 解决消息 0x02 初始化完成以后开始定义消息 0x03 在 DIALOG 头文件中添加消息处理函数 0x04 在 DIALOG 源文件中添加代码 0x05至此添加工具栏消息映射完
2017-01-04 21:05:07
375
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人