hardcoded constants

Walter Bright bright at Data-IO.COM
Thu Dec 22 05:35:36 AEST 1988


In article <1104 at goofy.megatest.UUCP> djones at megatest.UUCP (Dave Jones) writes:
<foo =  malloc( strlen(s) + strlen(t) + sizeof('\0'));
<Tells it all.  And keeps the reader on track, not grepping around
<for macros.

But doesn't sizeof('\0') return sizeof(int), instead of sizeof(char)?
Remember, the integral promotions are being done.



More information about the Comp.lang.c mailing list