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
一、概述1、定义类型typedef enum{ Monday, Tuesday}
DAY;2、使用DAY day = Monday;3、疑问 在定义和使用枚举类型的时候,我们并不知道枚举变量的存储空间是多大?现在开始做测试。二、Visual
C++ 6.0下测试#include typ...
分类:
其他好文 时间:
2014-05-09 10:08:35
阅读次数:
305
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
#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
MySQL源码中自己定义了许多数据结构,放在mysys的目录下,源码中通常都使用这些数据结构来组织存放数据,也更容易实现跨平台。下面先来看下MySQL定义的动态数组:【源代码include/array.h
mysys/array.c】typedef struct st_dynamic_array{ ...
分类:
数据库 时间:
2014-05-08 18:10:32
阅读次数:
392
#import // 利用typedef创建blocktypedef int
(^MyBlock) (int,int); // 表示遵守协议@protocol MyProtocol /*
1.reqiured:要求实现方法,不实现方法编译器会发出警告 2.optional:不要求实现方法 3.默.....
分类:
其他好文 时间:
2014-05-08 17:40:55
阅读次数:
225
闲来没事,看了看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
1.在typedef中使用指针往往会带来意外的结果。如下:typedef string
*pstring;const pstring cstr;绝大数人刚开始都会认为cstr是一种指针,它指向const对象,即const pstring cstr
等价于const string *cstr,其实,这...
分类:
其他好文 时间:
2014-05-08 12:52:54
阅读次数:
319
#import typedef enum { SexMan, SexWoman}
Sex;@interface Person : NSObject{ /* 成员变量名前用下划线有3个用处
1>方便程序员之间的交流,一看到下划线就知道这个事成员变量 2>为了与getter方法中的方法名区分开 3>不与...
分类:
其他好文 时间:
2014-05-08 11:43:57
阅读次数:
301
直接代码:代码段1: 1 #include 2 #include 3 #include 4 5
class some_class 6 { 7 public: 8 typedef void result_type; 9 void
print_string(const ...
分类:
编程语言 时间:
2014-05-08 09:49:53
阅读次数:
368