11 2012 档案

摘要:strtok 源码分析:char * __cdecl strtok ( char * string, const char * control ){ unsigned char *str; const unsigned char *ctrl = control; unsigned char map[32]; int count; static char *nextoken; /* Clear control map */ for (count = 0; c... 阅读全文
posted @ 2012-11-24 12:13 庄庄庄 阅读(451) 评论(0) 推荐(0)
摘要:00401292 <_main>:int main(int argc, char **argv){ 401292: 55 push %ebp 401293: 89 e5 mov %esp,%ebp 401295: 83 ec 18 sub $0x18,%esp 401298: 83 e4 f0 and $0xfffffff0,%esp 40129b: b8 00 00 00 00 mov $0x0,%eax 4012a0... 阅读全文
posted @ 2012-11-23 23:44 庄庄庄 阅读(497) 评论(0) 推荐(0)
摘要:#include <stdio.h>// 状态机int isRealNumber(char *p){ int state=1; int resualt=-1; while (*p) { switch(state) { case 1: if ('+'==*p||'-'==*p) { state=2; } else if (*p>='0'&&*p<='9') { state=4; } else if ('.'==*p) { state=3; } else { state=0; } 阅读全文
posted @ 2012-11-17 02:35 庄庄庄 阅读(371) 评论(1) 推荐(0)