Why can't I just declare a function without specifying the return type? Surely the C compiler would be able to figure out the type from what I am returning.
Name:
Anonymous2011-10-14 6:07
The official FAQ explains why C is so bad.
http://www.c-faq.com/malloc/sizeof.html Q: Why doesn't sizeof tell me the size of the block of memory pointed to by a 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.)