摘要: #include <stdio.h>#include <string.h>int hextodec(char *hex,int n){ unsigned dec=0; int i=n-1; //输入数组[0]为高位 if(hex==NULL || n<=0 || n>8) //输入十六进制最长为8字节(不包含'\0'字符) { printf("the parameter is invalid\n"); return -1; } while(i>=0) { if(hex[i]>='0'&& 阅读全文
posted @ 2012-05-31 20:47 always on the way 阅读(1006) 评论(0) 推荐(0) 编辑