On Thu, Nov 10, 2011, Doug Brewer wrote:
> I have the following lines in C:
> 
> struct foo *bar[10];
> 
> If I want to clear out that structure, should I use
> 
> memset(bar, 0, sizeof(bar));
> or
> memset(bar, 0, sizeof(*bar));

Your question is quite ambiguous as to "that structure".  There
are (presumably) 10 structures, somewhere.  And here is an array of
pointers.

Neither of your lines will clear out whatever "that structure" can
reasonably be interpreted to mean.

Reply via email to