2013年7月29日

关于malloc(0)的返回值问题--这两天的总结与实践篇

摘要: 就像我在http://www.cnblogs.com/wuyuegb2312/p/3219659.html文章中评论的那样,我也碰到了被提问这个malloc(0)的返回值问题,虽然感觉这样做在实际中没有任何意义,但既然被提问到了,那总得给点答复。当时的回答是“返回一个NULL指针”。就像@五岳查看man结果的一样,我也查看了,malloc() allocatessizebytes and returns a pointer to the allocated memory. The memory is notcleared. Ifsizeis 0, then malloc() returns e 阅读全文

posted @ 2013-07-29 13:00 净坛使者 阅读(25126) 评论(47) 推荐(5) 编辑

导航