摘要: char* buf = "安吉轻松2日游";int len;char * tmp = NULL;len = sizeof(char);//len=strlen(buf);strlen是指一个字符串的实际长度,从开始算到'\0'结束,而sizeof指一个数组定义的类型容量大小tmp = (char*)malloc(len);memset(tmp,0x00,len);//初始化指针内存 strcpy(tmp,buf);printf("tmp=%s\n",tmp);free(tmp);------------------------------ 阅读全文
posted @ 2011-09-13 17:04 火腿骑士 阅读(367) 评论(0) 推荐(0) 编辑
摘要: #include <malloc.h>#include <stdlib.h>#include <stdio.h>#include "queue.h"static resend_queue* head;static resend_queue* now;static resend_queue* tail;static resend_queue* temp;static resend_queue* del;static intqueue_num;static pthread_mutex_t lock_mute;bool queue_init() 阅读全文
posted @ 2011-09-13 11:25 火腿骑士 阅读(566) 评论(0) 推荐(0) 编辑