c语言基础: calloc

函数名: calloc
函数原型:void* calloc(unsigned int num,unsigned int size);
功能:在内存的动态存储区中分配num个长度为size的连续空间,函数返回一个指向分配起始地址的指针;如果分配不成功,返回NULL。
#define XCALLOC(x,size)  calloc(1,size)
#define XCALLOC(x,size)  calloc(1,size)
/* Allocate new thread master.  */
struct thread_master *
thread_master_create ()
{
  return (struct thread_master *) XCALLOC (8,
					   sizeof (struct thread_master));
}

  

posted on 2021-01-08 07:45  lydstory  阅读(541)  评论(0)    收藏  举报

导航