On Tue, Feb 14, 2006 at 07:07:04PM -0600, Brian Hurt wrote:
> > Also when the funcArr1 array is created it is created
> > as type pt2Function of size 10. But what's going on
> > with the {NULL} assignment? I'm pretty sure this is
> > some sort of initialization, but a quick glance says
> > it's initializing the 10th member of the array to NULL
> > but not the first 9. I know that's not right, but what
> > am I missing here?
> 
> This is bad form in C code.  It'll work, but it's a bad idea.  What he's 
> doing is initializing the *first* element in the array to NULL, and all 
> other elements to 0.  There is no gaurentee that NULL is 0- just that 
> *casting* 0 to a pointer type results in NULL.  This is generally true 
> however.  So the code works, generally.

Only if it is static. Otherwise, items 1 through 9 contain garbage.

florin

-- 
Don't question authority: they don't know either!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20060214/0dbcbdc3/attachment.pgp