摘要:
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);------------------------------ 阅读全文
摘要:
#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() 阅读全文