Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Language%20in%20C%20Interview%20Questions%20and%20Answers

Question: The sizeof( ) function doesnâ??t return the size of the block of memory pointed to by a pointer. Why?

Answer: The sizeof( ) operator does not know that malloc( ) has been used to allocate a pointer. sizeof( ) gives us the size of pointer itself. There is no handy way to find out the size of a block allocated by malloc( ).
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook