摘要: int main(int argc, char* argv[]){const char* pt = "ABC";const char* p = pt;char sz[1024]={0};char temp[4]={0};char x;while( 0 != *p ){x = *p;sprintf(temp,"%x" , x );strcat(sz, temp);p++;}printf("%s\n"... 阅读全文
posted @ 2007-06-30 22:44 曹立松 阅读(139) 评论(0) 推荐(0) 编辑
摘要: /*函数功能:将数字字符串转换为整型数参数: lpszIn 数字字符串地址; nLen 字符串长度返回值:转换后的整数值*/int StrToHex(char *lpszIn, int nLen){ int nRet = 0; for(int i = 1; i = 'A' && *lpszIn > 4; if(l_byTmp < 10) { ... 阅读全文
posted @ 2007-06-30 22:34 曹立松 阅读(2783) 评论(0) 推荐(0) 编辑
摘要: char* strchr (char* string, int c){ char *s; for (s = string; s && *s; s++) if (*s == c) { return (s); } return ((char *) NULL);} 阅读全文
posted @ 2007-06-30 17:05 曹立松 阅读(397) 评论(0) 推荐(0) 编辑
摘要: atof(将字符串转换成浮点型数)相关函数 atoi,atol,strtod,strtol,strtoul表头文件 #include 定义函数 double atof(const char *nptr);函数说明 atof()会扫描参数nptr字符串,跳过前面的空格字符,直到遇上数字或正负符号才开始做转换,而再遇到非数字或字符串结束时('')才结束转换,并将结果返回... 阅读全文
posted @ 2007-06-30 17:01 曹立松 阅读(470) 评论(0) 推荐(0) 编辑
摘要: client.c功能:向管道发送数据 #include #include #include #include #include #include #include #include #include #define SIP_PIPE "/tmp/sip-reg"#define MSG_SIZE 100int main(void){ int sip_writer_fd; st... 阅读全文
posted @ 2007-06-30 16:58 曹立松 阅读(453) 评论(0) 推荐(0) 编辑
摘要: 一、C语言的指针1.指针说明  指针是包含另一变量的地址变量。  (1)int *p  p是一个指针,指向一个整形数。  (2)int *p()  p是一个函数,该函数返回一个指向整数的指针。  (3)int (*p)()  p是一个指针,该指针指向一个函数,这个函数返回一个整数。  (4)int *p[]  p是一个数组,该数组的每一个元素是指向整数的指针。  (5)int (*p)[]  p是... 阅读全文
posted @ 2007-06-30 16:51 曹立松 阅读(708) 评论(0) 推荐(0) 编辑