ANSI C : test return from calloc API
This question already has an answer here:
As the documentation from cppreference says:
If size is zero, the behavior is implementation defined (null pointer may be returned, or some non-null pointer may be returned that may not be used to access storage)
Just don't do that.
http://en.cppreference.com/w/cpp/memory/c/calloc
链接地址: http://www.djcxy.com/p/79910.html上一篇: MinGW不会产生警告