NULL v. zero
Posted Jul 15, 2004 23:52 UTC (Thu) by
dododge (subscriber, #2870)
In reply to:
NULL v. zero by dvdeug
Parent article:
NULL v. zero
The header inclusion issue is in C, not C++. The differences in the languages mean that there is no single way to call malloc that works well for both of them.
If you're writing C++ you have to cast malloc because the compiler won't like the implicit conversion. If you're writing C you shouldn't cast it, in order to force the compiler to warn you if there's no prototype in scope.
Where you can run into trouble is when you've got code or a programmer moving betwen the two languages.
(
Log in to post comments)