码迷,mamicode.com
首页 >  
搜索关键字:struct tm    ( 20030个结果
从for_each开始说起 回调函数与仿函数
#include?<iostream> #include?<algorithm> using?namespace?std; //回调函数 void?call_back(char?elem) { ?cout?<<?elem?<<?endl; } //仿函数 struct?Functor { ?void?operator()?(char?elem)...
分类:其他好文   时间:2014-07-22 08:13:37    阅读次数:316
C语言结构体
直接上代码 struct People{ int age; } int main(){ struct People * p= malloc(sizeof(struct Perople)); p->age=10; struct People * p1=p; p-age=12; printf("%d\n",p1->age); free(p); return 0; } } 函...
分类:编程语言   时间:2014-07-21 10:22:57    阅读次数:222
求最大公约数和小于n的所有质数
//algorithm.henum SWAP_TYPE{MEMORY, COMPLEX};struct SIntArray{ int *pData; int num; SIntArray():pData(NULL),num(0){} void Clear(){delete ...
分类:其他好文   时间:2014-07-21 09:38:33    阅读次数:263
20140720
1、链表的反转 #include#includeusing namespace std;typedef struct ListNode{ int data; struct ListNode * Next;}ListNode;ListNode *ReverseList(ListNode *pHead)...
分类:其他好文   时间:2014-07-21 09:34:40    阅读次数:197
约瑟夫环问题
约瑟夫环是一个数学的应用问题:已知n个人(以编号1,2,3...n分别表示)围坐在一张圆桌周围。从编号为k的人开始报数,数到m的那个人出列;他的下一个人又从1开始报数,数到m的那个人又出列;依此规律重复下去,直到圆桌周围的人全部出列。 C代码如下: #include #include #include typedef struct _node { struct _node* next;...
分类:其他好文   时间:2014-07-21 09:32:50    阅读次数:222
C#中结构与类的区别
一.类与结构的示例比较: 结构示例: 1 public struct Person 2 { 3 string Name; 4 int height; 5 int weight 6 public bool overWeight() 7 { 8 //implement something ...
分类:其他好文   时间:2014-07-20 23:39:51    阅读次数:317
POJ3468A Simple Problem with Integers
#include #include #include using namespace std; struct CNode { int L,R; CNode* pLeft,* pRight; long long Inc; long long nSum; }; CNode Tree[200010]; int nCount=0; int Mid(CNode* pRoot)...
分类:其他好文   时间:2014-07-20 22:38:44    阅读次数:245
POJ3264Balanced Lineup(最基础的线段树)
采用一维数组建树。(因为一维数组建的是完全二叉树,时间上比用孩子节点指针建树慢,不过基本可以忽略=-=) #include #include #include using namespace std; const int INF = 0xffffff0; int minV=INF; int maxV=-INF; struct Node { int L,R; int minV,ma...
分类:其他好文   时间:2014-07-20 22:28:44    阅读次数:216
网络编程Socket之TCP之close/shutdown详解
close: 当套接字的引用计数为0的时候才会引发TCP的四分组连接终止序列;   shutdown: 不用管套接字的引用计数就激发TCP的正常连接终止序列; 这里由一个SO_LINGER套接字选项 struct linger {      int l_onoff; /* 0 = off, nozero = on */      int l_linger; ...
分类:其他好文   时间:2014-07-20 22:24:53    阅读次数:367
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!