标签:
char buff[100];
bzero(buff,100);将buff中最开始的n个字节清空;
-----------------
struct stat file_info;
unsigned char *jpg_buffer;
jpg_buffer = (unsigned char *)calloc(1,file_info.st_size);//为jpg_buffer分配一块file_info.st_size大小的堆内存
-----------------------------
char *p;
p = (char *)malloc(10);//为p分配10字节区域在堆区;
------------------------
char *p = "123456";//在常量区 ,p在栈上;
----------------------------------
malloc calloc均是用free来释放;
标签:
原文地址:http://www.cnblogs.com/defen/p/5189553.html