Vidyalelo
C Programming · Q12

Memory Allocation

Programming · C Programming · question 12

Q12

How do you check if the 'malloc' function has successfully allocated memory in C?

A.
Check if the return value is not NULL
Answer
B.
Check if the return value is 1
C.
Check if the return value is -1
D.
Check if the return value is 0

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board