Q: Why doesn't sizeof tell me the size of the block of memory pointed to by a pointer?
A: sizeof tells you the size of the pointer. There is no portable way to find out the size of a malloc'ed block. (Remember, too, that sizeof operates at compile time, and see also question 7.27.)