码迷,mamicode.com
首页 >  
搜索关键字:struct enum    ( 22969个结果
认真体会 结构体中的零长度数组
以前只是知道这个东西,可以解决一些问题,最近自己做一个字符串操作的东东,看了下redis的源码,做个小的总结。struct cl_str_s{ int free; int len; char buf[];}; 代码的意思是,我们定义了一个结构体,它有这么三个属性,作用很明显不详细...
分类:其他好文   时间:2014-07-13 09:25:28    阅读次数:158
【Nginx】请求上下文
上下文与全异步web服务器的关系请求上下文指在一个请求的处理过程中,把一些关键的信息保存下来的类似struct这样的结构体。每个http模块都可以有自己的上下文结构体,一般都是在刚开始处理请求时在内存池上分配它,之后当经由epoll、http框架再次调用到http模块的处理方法时,这个http模块可...
分类:其他好文   时间:2014-07-13 08:09:49    阅读次数:218
简单Factory模式
#pragma once#include "student.h"#include "Teacher.h"typedef enum _EPersonType{ ePersonUndefin = 0, ePersonStudent, ePersonTeacher}EPersonType...
分类:其他好文   时间:2014-07-13 00:36:51    阅读次数:216
C 动态链表的建立,输出,删除,插入
动态链表的建立,输出,删除,插入 #include #include #include #define NULL 0 #define LEN sizeof(struct student) struct student {     long num;     float score;     struct student*next; };  int n;/*n为全...
分类:其他好文   时间:2014-07-12 23:23:33    阅读次数:183
Effective C++ Item 37 绝不重新定义继承而来的缺省参数值
经验:绝对不要重新而来的缺省参数值,因为缺省参数值都是静态绑定,而 virtual 函数 -- 你唯一应该覆写的东西 -- 却是动态绑定 示例: class Shape{ public: enum ShapeColor {Red, Green, Blue}; virtual void draw(ShapeColor color = Red) const = 0; }; class Rectangle: public Shape{ public: virtual void draw(ShapeColor...
分类:编程语言   时间:2014-07-12 21:22:15    阅读次数:278
二叉查找树
引言:         使二叉树成为二叉查找树的性质是:对于树中的每个节点X,它的左子树中所有关键字值小于X的关键字值,而它的右子树中所有关键字值大于X的关键字值。 二叉查找树声明 struct TreeNode; typedef struct TreeNode *Position; typedef struct TreeNode *SearchTree; struct T...
分类:其他好文   时间:2014-07-12 19:25:31    阅读次数:179
hdu 1051 Wooden Sticks
简单贪心。 将所给数据从小到大进行排序,将所给零件的两数据均小于另一个零件的两数据,看做一个集合。 最后输出集合个数。#include #include #include #include #include using namespace std; struct www { int x,y; }s[5005]; int yy[5005],a,b; bool cmp(www q,w...
分类:其他好文   时间:2014-07-12 19:01:39    阅读次数:208
队列——数组实现
引言:        队列的实现除了链表外,也可用数组实现。 分析描述:       队列的结构: typedef int ElementType; typedef struct QueueRecord{ int Capacity; int Front; int Rear; int Size; ElementType *Array; }QueueRecor...
分类:其他好文   时间:2014-07-12 17:50:16    阅读次数:213
C++中对象指针的使用
//定义结构 Box.h: #ifndef BOX_H #define BOX_H struct Box{ double length; double width; double height; double volume(); }; #endif //定义volume方法 t1.cpp: #include "box.h" double Box::volume(...
分类:编程语言   时间:2014-07-12 17:25:50    阅读次数:152
单链表的初始化和创建(尾插法)
1 #include 2 #include 3 typedef struct Node 4 { 5 int data; 6 struct Node *next; 7 }Node,*LinkList; 8 9 void initList(LinkList *L)10 {11 ...
分类:其他好文   时间:2014-07-12 14:38:30    阅读次数:201
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!