For a non-NULL result, what does the C standard guarantee about the pointer returned by malloc?
Correct answer
B. It is aligned for any type with a fundamental alignment
15 views
B. It is aligned for any type with a fundamental alignment
15 views
The block returned by malloc is aligned so that it can hold any object type with a fundamental alignment requirement, which is why the result may be assigned to any pointer type without a misalignment fault.
Asked in: NTS, PPSC IT, Campus Interviews
Not sure why the answer is B? Ask here and get an explanation.