What is the portable way to check whether malloc failed to allocate non-zero memory block?
malloc
According to the Single Unix Specification, malloc will return NULL and set errno when it fails.
NULL
errno
1.4m articles
1.4m replys
5 comments
57.0k users