码迷,mamicode.com
首页 >  
搜索关键字:struct tm    ( 20030个结果
linux tcp server demo
#include #include #include #include #include #include #define MAXLINE 80 #define SERV_PORT 6970 void do_echo(int sockfd, struct sockaddr *pcl...
分类:系统相关   时间:2014-05-27 18:06:51    阅读次数:435
(原创)舌尖上的c++--相逢
引子 前些时候,我在群里出了一道题目:将变参的类型连接在一起作为字符串并返回出来,要求只用函数实现,不能借助于结构体实现。用结构体来实现比较简单:template struct Connect;templatestruct Connect{ static string GetName() ...
分类:编程语言   时间:2014-05-27 16:25:51    阅读次数:492
C++ pair(对组)用法
类模板:template struct pair参数:T1是第一个值的数据类型,T2是第二个值的数据类型。功能:pair将一对值组合成一个值,这一对值可以具有不同的数据类型(T1和T2),两个值可以分别用pair的两个公有函数first和second访问。具体用法:1.定义(构造):1 p...
分类:编程语言   时间:2014-05-26 17:54:31    阅读次数:327
基于十字链表的两个稀疏矩阵相乘
#include #include #include typedef int DataType;// 稀疏矩阵的十字链表存储表示typedef struct LNode{ int i,j; // 该非零元的行和列下标 DataType e; // 非零元素值 struc...
分类:其他好文   时间:2014-05-25 23:13:33    阅读次数:295
2014年百度之星程序设计大赛 - 初赛(第二轮)
1001 暴力 #include #include #include using namespace std; const int maxn = 100100; int ll[maxn], rr[maxn]; struct node { int x, y, bj; }e[maxn]; int main() { int cas = 1; int T; scanf("%d...
分类:其他好文   时间:2014-05-25 21:32:50    阅读次数:268
一个让人崩溃的编码错误
最近写了一个接受socket数据包,然后再重组上层协议包的东西。每次read到数据就将数据添加到一个链表的尾部,然后检查是否收到了一个完整的包。为了减少内存碎片,把用过的链表节点添加到另外一个链表中,这样下次可以从这个cache链表中重用节点。        在debug的时候我把cache list中的数据打印出来,代码如下: struct seg_node {     void* bu...
分类:其他好文   时间:2014-05-25 21:31:09    阅读次数:326
广度优先遍历二叉树
?? // //广度优先遍历二叉树 // //从一个顶点开始,识别所有可到达顶点 // //的方法叫作广(宽)度优先搜索,这种 // //搜索可使用队列来实现 typedef struct binarytree { EleType data; struct binarytree *LeftChild; struct binarytree *RightChild...
分类:其他好文   时间:2014-05-25 18:25:35    阅读次数:316
linux0.12内核的内存组织和进程结构
进程结构 Linux0.12中的每个进程都有如下的结构: 在gdt中占有两项,一项是tss段描述符,一项是ldt段描述符。 在task数组中占有一项,指向一页物理内存,该物理内存低端是进程控制块task_struct(里面包括tss段和ldt段),其余部分是进程的内核态堆栈。 在页目录表和页表中设置有相关项。 Linux0.12中,最多只有64个进...
分类:系统相关   时间:2014-05-25 18:19:08    阅读次数:329
hdu 1.3.3 今年暑假不AC
//简单.... 1 #include 2 #include 3 #include 4 using namespace std; 5 6 #define maxn 105 7 8 struct t 9 {10 int s;11 int e;12 };13 14 t T[maxn]...
分类:其他好文   时间:2014-05-25 16:04:07    阅读次数:215
顺序循环队列的c语言实现
1. 循环队列的顺序存储结构 typedef struct { QElemType data[MAXSIZE]; int front; /* 头指针 */ int rear; /* 尾指针,若队列不空,指向队列尾元素的下一个位置 */ }SqQueue; 2. 初始化一个空队列Q Status InitQueue(SqQueue *Q) { Q->fr...
分类:编程语言   时间:2014-05-25 04:43:05    阅读次数:407
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!