NoFear

导航

2011年12月8日

摘要: View Code int LoadDictionary(){ FILE *fp; fp=fopen("formatpwd.txt","rb"); fseek(fp,0,SEEK_END); size_t DicLength=ftell(fp); fseek(fp,0,SEEK_SET); char * pbuf = new char[DicLength+1]; memset(pbuf,0,DicLength); fread(pbuf,sizeof(char),DicLength,fp); PWD pwd; size_t offset... 阅读全文

posted @ 2011-12-08 11:07 Fear_Hao 阅读(182) 评论(0) 推荐(0) 编辑

2011年12月6日

摘要: View Code //in.txt://File Flag 2DPatch//1 3216//2 3216 (2548-3216 x 4)//3 3216 (2552-3216 x 4)//4 3212 (2556-3212 x 4)//5 3208 (2564-3216 x 4)//6 3204 (2572-3216 x 4)//7 3196 (2580-3216 x 4)//8 3192 (2588-3216 x 4)//9 3188 (2596-3216 x 4)//10 3184 (2548-3216 x 4)//11 3180 (2548-3216 x 4)//文档就是这样的格式, 阅读全文

posted @ 2011-12-06 14:11 Fear_Hao 阅读(194) 评论(0) 推荐(0) 编辑

摘要: View Code //************************************// 函数: HexToBin// 参数: const char * src// 参数: unsigned char * bin// 参数: int & len// 返回: void// 作用: 16进制 to 2进制//************************************void HexToBin(const char* src, unsigned char* bin, int &len){ //printf("... 阅读全文

posted @ 2011-12-06 11:52 Fear_Hao 阅读(338) 评论(0) 推荐(0) 编辑

摘要: View Code //************************************// 函数: BinToHex// 返回: void// 作用: 2进制文件转16进制文件//************************************void BinToHex(){ FILE *FpIn , *FpOut; int c ; FpIn=fopen("bin.txt","rb"); FpOut=fopen("Hex.txt","w"); if (NULL==FpIn) { printf(&q 阅读全文

posted @ 2011-12-06 11:02 Fear_Hao 阅读(389) 评论(0) 推荐(0) 编辑

2011年12月5日

摘要: View Code #include <stdio.h>#include <string>int main() { char list[] = "adfafa,sdfafaf,sdfsdfaf,sdfafaf,sdffafs"; char list2[10][20]={0}; char rule[] = ","; char *token; int tmplen=0; int offset=0; int num=0; token = strtok(list, rule); while (token!=NULL) { ... 阅读全文

posted @ 2011-12-05 16:40 Fear_Hao 阅读(461) 评论(0) 推荐(0) 编辑

2011年12月4日

摘要: View Code int max=100; //总数 int per = max/100; //每份 int flag=1; //1%标志 for(int i=0;i!=max;i++) { if(i/per >= flag) { flag++; if(flag%10==0) { ... 阅读全文

posted @ 2011-12-04 14:32 Fear_Hao 阅读(154) 评论(0) 推荐(0) 编辑

摘要: View Code //************************************// 函数: FindFileName// 返回: int// 作用: 所有当前目录匹配的文件名//************************************char * filename[20={0};int FindFileName(){ WIN32_FIND_DATA data; HANDLE hfind; char nameRule[6]={0}; char tempname[100]={0}; int i=0; ... 阅读全文

posted @ 2011-12-04 14:12 Fear_Hao 阅读(198) 评论(0) 推荐(0) 编辑

2011年11月24日

摘要: View Code char* _strstr(char* haystack,char* needle){ //逐位 for(;;++haystack) { char* h = haystack; for(char* n = needle;;++n,++h) { //匹配段空返回 if(!*n) return haystack; //1.先找到需要比较的开头 2.比较当前字符 if(*h !=*n) ... 阅读全文

posted @ 2011-11-24 22:06 Fear_Hao 阅读(124) 评论(0) 推荐(0) 编辑