码迷,mamicode.com
首页 >  
搜索关键字:struct dpif_class    ( 18974个结果
socket编程——sockaddr_in结构体操作
sockaddr结构体sockaddr的缺陷:struct sockaddr 是一个通用地址结构,这是为了统一地址结构的表示方法,统一接口函数,使不同的地址结构可以被bind() , connect() 等函数调用;sa_data把目标地址和端口信息混在一起了struct sockaddr { un...
分类:其他好文   时间:2014-07-16 19:22:47    阅读次数:232
POJ 3468 A Simple Problem with Integers
线段树的指针表示法。代码还有待消化。。代码里面多次用到了函数递归,感觉这次对递归又有了深一层的理解。 1 #define LOCAL 2 #include 3 #include 4 #include 5 using namespace std; 6 7 struct CNode...
分类:其他好文   时间:2014-07-16 19:07:23    阅读次数:249
计算几何模板
白书上部分代码#include #include #include #include using namespace std;const double esp = 1e-10;struct Point{ double x,y; Point(double x = 0,double y = ...
分类:其他好文   时间:2014-07-16 18:48:34    阅读次数:207
poj1659Havel-hakimi 定理
#include #include #include #include #include #include #include #include #include #include #include #include using namespace std;struct Node{ int x;...
分类:其他好文   时间:2014-07-16 18:46:18    阅读次数:145
uva 1421
稍微有点新意的二分#include#include#include#include#include#include#include#define eps 0.000001#define maxn 5005using namespace std;int n;double w;struct node{ ...
分类:其他好文   时间:2014-07-16 17:47:10    阅读次数:206
c语言 struct结构体的变量声明加冒号
本文详细介绍了结构体中位域相关使用说明。有些信息在存储时,并不需要占用一个完整的字节,而只需占几个或一个二进制位。例如在存放一个开关量时,只有0和1两种状态,用一位二进位即可。为了节省存储空间,并使处理简便,C语言又提供了一种数据结构,称为“位域”或“位段”。所谓“位域”是把一个字节中的二进位划分为几个不同的区域,并说明每个区域的位数。每个域有一个域名,允许在程序中按域名进行操作。这样就可以把几个不同的对象用一个字节的二进制位域来。...
分类:编程语言   时间:2014-07-16 17:27:16    阅读次数:757
高性能编码准则
1.字节边界对齐 提高读写速度2.构造函数尽量使用初始化列表(不然对象类型会有一次默认构造 初始值)3.尽量使用前置++ ,因为后置++会生成临时对象4.不要用结构体着函数返回值 struct a; a=f(1) ; 会生成临时对象 struct a = f(1); 这样不会生成临时对象5....
分类:其他好文   时间:2014-07-15 22:57:36    阅读次数:313
Effective C++ Item 47 请使用 traits classes 表现类型信息
经验:Traits classes 使得"类型相关信息"在编译期可用。它们以 templates 和 "templates 特化"完成实现 示例: template class deque{ public: class iterator{ public: typedef random_access_iterator_tag iterator_category; }; }; //template template struct iterator_trai...
分类:编程语言   时间:2014-07-15 22:40:20    阅读次数:372
链表(一)——创建一个最基本的单向链表
1.结点 链表中用来存储一个数据的存储单元。 一个链表至少需要由两部分组成,就是数据域和指针域,一般形式的结点定义为: struct node {     Elem data; //Elem类型泛指基本数据类型     struct node *next; } typedef struct node Elemsn; 以上两步等价于: typedef struct node {...
分类:其他好文   时间:2014-07-15 13:01:24    阅读次数:281
hdu 4544 湫湫系列故事——消灭兔子 优先队列+贪心
将兔子的血量从小到大排序,箭的威力也从小到大排序, 对于每只兔子将威力大于血量的箭加入队列,写个优先队列使得出来数位价钱最少。。 #include #include #include #include #include using namespace std; const int maxn=100010; struct tt { int d; int p; bool operator<...
分类:其他好文   时间:2014-07-15 12:52:52    阅读次数:321
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!