2.calloc函数
函数原型为void*calloc(unsigned int num, unsigned int size)
按所给数据个数和每个数据所占字节数开辟存储空间。其中num为数据个数,size为每个数据所占字节数,故开辟的总字节数为num*size.函数返回该存储区的起始地址。calloc函数与malloc 函数的区别仅在于一次可以分配n块区域。例如:ps=(struct stu*) calloc(2,sizeof (struct stu)); 其中的sizeof(structstu)是求stu的结构长度。因此该语句的意思是:按stu的长度分配2块连续区域,强制转换为stu类型,并把其首地址赋予指针变量ps.
http://www.fengone.com/bj/jsqy/2014/0408/476498.html
http://www.xyzc.cn/health/bjys/2014-04-08/1564165.html
http://www.rznews.cn/yszx/stbk/5319078836.html
http://www.yltvb.com/xwbk/redianxinwen/5321232003.html
http://www.js0573.com/yx/jsfs/3905330.html
http://www.fengone.com/bj/jsqy/2014/0408/476483.html
http://www.lfxww.com/2014/shichangshangxun/2014/0408/774692.html
http://www.yltvb.com/xwbk/jkxx/5321310205.html
http://www.lfxww.com/2014/shichangshangxun/2014/0408/774900.html
http://www.yltvb.com/xwbk/jkxx/5322011587.html
http://www.js0573.com/yx/dzdy/3906385.html
http://www.fengone.com/bj/zxzx/2014/0408/476503.html
http://www.yltvb.com/xwbk/jkxx/5322005940.html
http://www.yltvb.com/xwbk/redianxinwen/5327440660.html
http://www.zznews.cn/hyzx/jkxx/5322746638.html
http://www.fengone.com/bj/zxzx/2014/0408/478595.html
http://www.yltvb.com/xwbk/jkxx/5330071568.html
http://www.yltvb.com/xwbk/redianxinwen/5327447234.html
http://www.zznews.cn/hyzx/jkxx/5322822829.html
http://www.yltvb.com/xwbk/jkxx/5330075051.html
http://www.fengone.com/bj/jsqy/2014/0408/478598.html
http://www.yltvb.com/xwbk/jkxx/5330084646.html
http://www.yltvb.com/xwbk/redianxinwen/5327472816.html
http://www.fengone.com/bj/jsqy/2014/0408/478608.html