Re: Typecasting Pointers

From: Flash Gordon (spam_at_flash-gordon.me.uk)
Date: 11/26/04


Date: Fri, 26 Nov 2004 00:22:06 +0000

On Wed, 24 Nov 2004 13:59:50 -0700
brian <tweaker@cox.net> wrote:

> Barry Schwarz wrote:
> > On Tue, 23 Nov 2004 14:03:36 -0700, brian <tweaker@cox.net> wrote:
> [snip]
>
> >>(void)memset(a, 1, sizeof(struct foo));
>
> This should be to 0 or NULL. My mistake.

<snip>

That doesn't help much. Since the second argument is an int and NULL
could be ((void *)0) a call of
   (void)memset(a, NULL, sizeof(struct foo));
could require a diagnostic.

Even a 0 does not help much as this would set it to all bits 0 and all
bits 0 might not be the correct value.

-- 
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.


Relevant Pages