that's what I was talking about. he had (structure*)=malloc(64) which means that if structure (what ever that may be) changes, it's only going to get 64 bytes
Thanks, Tyler Littlefield Web: tysdomain.com email: [email protected] My programs don't have bugs, they're called randomly added features. ----- Original Message ----- From: Paul Herring To: [email protected] Sent: Thursday, May 07, 2009 5:16 AM Subject: Re: [c-prog] Re: malloc On Thu, May 7, 2009 at 12:07 PM, Tyler Littlefield <[email protected]> wrote: > should also use sizeof(structure) Well, not really, you should use: storage = malloc (sizeof *storage); That way it doesn't matter if you change the type of 'storage.' <snip> -- PJH http://shabbleland.myminicity.com/com http://www.chavgangs.com/register.php?referer=9375 [Non-text portions of this message have been removed]
