随笔分类 -  小程序

成员函数指针和模板混用,折腾。。
摘要:template class CFooImpl { protected: void callfoo() { T* t = static_cast(this); t->foo(); } void callfoo(void(T::* f)()) { // how to call f ?? ... 阅读全文

posted @ 2016-05-22 22:24 devcfei 阅读(157) 评论(0) 推荐(0)

.................bug
摘要://fifo.cpp:定义控制台应用程序的入口点。//#include"stdafx.h"#include<windows.h>#defineBUF_MAX1024#defineLIST_MAX4structLIST{volatileinthead;volatileinttail;volatileintempty;volatileintfull;size_tsize[LIST_MAX];char*buff;};structLISTswreg;HANDLEhWrite;HANDLEhRead;voidwait_write(){printf("%s\n&q 阅读全文

posted @ 2011-03-04 21:36 devcfei 阅读(310) 评论(0) 推荐(0)

需要随机数表,自己做个程序生成*.c *.bin
摘要:/* rram.c 用于生成随机数组 不支持M级 例: rram 1024 rram 1 k rram 1 K rram 2048 rram 2 k rram 2 K */ #include <stdio.h> #include <stdlib.h> #include <time.h> void print_info() {    ... 阅读全文

posted @ 2009-08-07 21:29 devcfei 阅读(405) 评论(0) 推荐(0)

修改c2html为cpp2html经验
摘要:本人修该c2html为cpp2html,只是为分享开源代码的修改经验,并自己动手得到一个自己需要的工具 c2html.h里面修改字体,TAB字符数 convert.c修改高亮方式 check_begin.c添加关键字 check_end.c修改预编译宏结束条件 write_header_footer.c修改字体大小和字符集 另外check*.c里修改了hex的判断条件,我认为这是原来的一个bug,... 阅读全文

posted @ 2009-07-24 23:01 devcfei 阅读(547) 评论(0) 推荐(0)

将一个句子中的单词翻转
摘要:/*将一个句子中的单词翻转*/ #include <stdio.h> char* strrevw(char* string){     char* s=string;     char* e=s;     char  ch;     char *ws,*we... 阅读全文

posted @ 2009-05-29 19:45 devcfei 阅读(839) 评论(0) 推荐(0)