码迷,mamicode.com
首页 >  
搜索关键字:typedef struct    ( 24378个结果
MySQL源码 数据结构hash
MySQL源码自定义了hash表,因为hash表具有O(1)的查询效率,所以,源码中大量使用了hash结构。下面就来看下hash表的定义:【源代码文件include/hash.h mysys/hash.c】typedef uint my_hash_value_type;typedef uchar *...
分类:数据库   时间:2014-05-09 10:50:26    阅读次数:485
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
Qt由pcm数据生成wav文件
void AudioGrabber::saveWave(const QString &fileName, const QByteArray &raw, const QAudioFormat &format){ typedef struct{ char riff_fileid[4];//"RIFF" ...
分类:其他好文   时间:2014-05-09 05:01:23    阅读次数:434
HDU 3081 Marriage Match II 二分+最大流
题目来源:HDU 3081 Marriage Match II 题意: 思路:   错误代码 纠结不知道哪错了 先放一放 #include #include #include #include #include using namespace std; const int maxn = 1010; const int INF = 999999999; struct Edg...
分类:其他好文   时间:2014-05-09 02:38:25    阅读次数:264
linux 内核源码分析 - 获取数组的大小
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))   测试程序: #include #include struct dev { int a; char b; float c; }; struct dev devs[]= { { 1,'a',7.0, }, { 1,'a',7.0, }, { ...
分类:系统相关   时间:2014-05-09 02:10:16    阅读次数:494
通过fstat函数判断描述符类型
fstat函数用于返回关于文件的信息到一个struct stat结构中,stat结构中的st_mode可以用来区分文件类型。 struct stat { dev_t st_dev; /* ID of device containing file */ ino_t st_ino; /* inode ...
分类:其他好文   时间:2014-05-09 02:01:26    阅读次数:379
字符串解析
#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
LeetCode -- Remove Duplicates from Sorted List
题目链接简单题,就是从单链表中删除重复元素。附上代码: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * L...
分类:其他好文   时间:2014-05-08 18:02:52    阅读次数:338
黑马程序员 block,protocol
#import // 利用typedef创建blocktypedef int (^MyBlock) (int,int); // 表示遵守协议@protocol MyProtocol /* 1.reqiured:要求实现方法,不实现方法编译器会发出警告 2.optional:不要求实现方法 3.默.....
分类:其他好文   时间:2014-05-08 17:40:55    阅读次数:225
c语言来实现c++
闲来没事,看了看sqlite的源码,突然想用c实现c++,写了如下demo #include #include struct Class; typedef struct Class _Class; struct IMethod { void (*ctor)(_Class *c); void (*dtor)(_Class *c); int (*sum)(_Class* c); in...
分类:编程语言   时间:2014-05-08 16:14:30    阅读次数:363
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!