Question: Consider the following code: voidp=malloc(1000) This call to malloc may fail if the system cannot locate a block of unused memory that is as large

Consider the following code: voidp=malloc(1000) This call to malloc may fail if the system cannot locate a block of unused memory that is as large as requested. How can the program know if this malloc has failed? malloc return 1 there is no way for the program to determine if malloc failed. malloc prints a statement of failure to stdout malloc returns NULL malloc throws an OutOfMemoryException
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
