摘要:
三个函数的申明分别是:void* realloc(void* ptr, unsigned newsize);void* malloc(unsigned size);void* calloc(size_t numElements, size_t sizeOfElement);都在stdlib.h函数库内它们的返回值都是请求系统分配的地址,如果请求失败就返回NULLmalloc用于申请一段新的地址,参数size为需要内存空间的长度,如:char* p;p=(char*)malloc(20);calloc与malloc相似,参数sizeOfElement为申请地址的单位元素长度,numElement 阅读全文