码迷,mamicode.com
首页 >  
搜索关键字:struct enum    ( 22969个结果
【LeetCode】Populating Next Right Pointers in Each Node
Populating Next Right Pointers in Each NodeGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLi...
分类:其他好文   时间:2014-05-10 00:32:56    阅读次数:326
boost::function实践——来自《Beyond the C++ Standard Library ( An Introduction to Boost )》
代码段1: 1 #include 2 #include 3 4 5 float mul_ints(int x, int y) { return ((float)x) * y; } 6 struct int_div { 7 float operator()(int x, int y)...
分类:编程语言   时间:2014-05-09 23:38:56    阅读次数:487
C语言实现状态设计模式
#include #include #include #ifndef VIRTUAL #define VIRTUAL #endif #ifndef DELETE #define DELETE(X) do { free(X);X = NULL; } while(0) #endif #define NEW(TYPE,pInstance,SUBTYPE) struct TYPE* pInst...
分类:编程语言   时间:2014-05-09 22:29:48    阅读次数:455
【HDOJ】2612 Find a way
BFS。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define INF 0x3fffffff 8 9 typedef struct node_st {10 int x, y, ...
分类:其他好文   时间:2014-05-09 20:18:48    阅读次数:339
[python网络编程]DNS服务器
在上一篇中,使用scrapy修改源IP发送请求的最后我们提到由于hosts文件不支持正则,会导致我们的随机域名DNS查询失败。是用DNS服务器可以解决这个问题,下面是我用gevent写的小工具,很简单。我们只拦截匹配的A记录,然后发送DNS Response,如果不匹配,那么我们服务器就是一个DNS代理,转发请求。# -*- coding=utf-8 -*- import struct from...
分类:编程语言   时间:2014-05-09 13:49:34    阅读次数:560
struct timespec 和 struct timeval
time()提供了秒级的精确度 .1、头文件 2、函数原型 time_t time(time_t * timer) 函数返回从TC1970-1-1 0:0:0开始到现在的秒数 用time()函数结合其他函数(如:localtime、gmtime、asctime、ctime)可以获得当前...
分类:其他好文   时间:2014-05-09 10:20:45    阅读次数:343
论枚举类型的存储空间
一、概述1、定义类型typedef enum{ Monday, Tuesday} DAY;2、使用DAY day = Monday;3、疑问 在定义和使用枚举类型的时候,我们并不知道枚举变量的存储空间是多大?现在开始做测试。二、Visual C++ 6.0下测试#include typ...
分类:其他好文   时间:2014-05-09 10:08:35    阅读次数:305
vs05字节对齐问题又一不小心就弄去了我一个下午的时间
由于一字节的对齐问题,我调一个库调了我基本一个下午.....犯错其实并不可怕,可怕的是你一犯再犯......这也算得上是难能可贵.../Zp (Struct Member Alignment)Visual Studio 2013Other VersionsThis topic has not yet...
分类:其他好文   时间:2014-05-09 09:40:28    阅读次数:306
循环顺序队列
#include using namespace std; const int MAXQSIZE = 5; //队列类 template struct LinkList { T * data;//指向连续的数据存储区域 int front;//头指针 指向第一个元素 int rear;//尾指针 如果队列不为空指向最后元素的下一个位置 }; //构造一个空队列 template void...
分类:其他好文   时间:2014-05-09 06:07:53    阅读次数:248
字符串解析
#include #include #define FALSE 0  //函数执行错误返回0 #define TRUE 1 //函数执行正确返回1 //串的堆分配存储表示 typedef struct { char *ch; int length; }String; //对串的所有操作都可以通过以下五个基本函数实现 void StrInit(String *);//串的初始化...
分类:其他好文   时间:2014-05-09 01:25:02    阅读次数:294
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!