initializing null pointers

stuart at bms-at.UUCP stuart at bms-at.UUCP
Tue Jan 20 14:44:13 AEST 1987


A statically declared pointer is guaranteed to be initialized to
NULL if no initializer (or 0) is given.

What about pointer arrays allocated with calloc()?  Does one have to
initialize all the elements in a loop to be portable (despite the fact
that it is unnecessary on most machines)?  Evidently, yes.  But is there
a better way?  In this repect, a built-in 'new' operator has some advantages.

I already have lots of code that needs to be fixed to be
portable :-(
-- 
Stuart D. Gathman	<..!seismo!dgis!bms-at!stuart>



More information about the Comp.lang.c mailing list