最近在看nginx源码,看到定时器的时候,发现一个结构体利用偏移量求值问题,结构体相信做c开发的都遇到过,那么不知你对结构体中成员变量偏移这块是如何理解的;首先我们先看一下nginx中的那个让我迷惑的地方ev = (event_t*)((char*)node - offsetof(event_t,....
分类:
编程语言 时间:
2014-07-03 10:46:15
阅读次数:
234
cat ascii.hex | ascii2binary -b h -t us > ascii.bin x86dis -e 0 -s att -f ascii.bin echo "d8 01 77 c4 90 90 90 90" | ascii2binary -b h -t uc | x86d...
分类:
其他好文 时间:
2014-07-03 10:07:55
阅读次数:
275
1.让每次启动程序运行都能产生不同的随机数:#include int main(){ srand(time(0));// set a new seed for random function}2.产生随机数在srand statement 之后:(1)产生0到a的随机数:rand%(a+1); .....
分类:
其他好文 时间:
2014-07-03 09:36:33
阅读次数:
171
1. Error: Dangling meta character '*' near index 0对字符串使用split()方法截取 * ? + / | 等字符的时候会报以下异常 Dangling meta character '?' near index 0 ?+、*、|、\等符号在正则表达示中...
分类:
编程语言 时间:
2014-07-03 07:13:36
阅读次数:
222
论asp.net out、ref、returnref(引用类型)ref引用类型进出都必须赋值,赋值后会改变类型原来的指针。out(值类型)out值类型进可以不赋值,出必须赋值。return(返回函数类型)return必须返回函数对应的类型。ref实例:protected void Page_Load...
分类:
Web程序 时间:
2014-07-03 06:33:19
阅读次数:
369
下面语句是设置SQL Server数据库是否区分大小写:(表名和数据库字段名)--修改数据库不区分大小写alter database数据库名称 COLLATE Chinese_PRC_CI_AS如:alter database zjk_cx COLLATE Chinese_PRC_CI_AS--修改...
分类:
数据库 时间:
2014-07-02 21:56:26
阅读次数:
224
由于C语言里面没有字符串,所以要输入和输出字符串,就用数组代替了也可以用 getsvoid String_003(){ char str[50]; gets(str); printf("%s",str);}记得,在字符串的后面要加一个 /0 否则,可能会加入一些其他的数组
分类:
编程语言 时间:
2014-07-01 17:56:05
阅读次数:
204
Since I use Sublime ,I want to write aencoding convent program .Here isthe knowage what i need .InputStreamReader:This class is the brage from bytetyp...
分类:
其他好文 时间:
2014-07-01 13:57:23
阅读次数:
214
#include
char RandString();
int main( void )
{
int i=0;
char cTemp;
char sKey[9];
memset(&cTemp, 0, sizeof(cTemp));
memset(sKey, 0, sizeof(sKey));
sran...
分类:
其他好文 时间:
2014-07-01 08:05:02
阅读次数:
173
#include
#include
#define MAX_MSG_BUF_LEN 512
int iKey = 6004;
struct ipcmsgbuf
{
long mtype;
char mtext[MAX_MSG_BUF_LEN];
};
int main( void )
{
int qid;
cha...
分类:
其他好文 时间:
2014-07-01 06:50:31
阅读次数:
199