Am Dienstag, 29. Mai 2007 schrieb [EMAIL PROTECTED]: > On Tue, 29 May 2007 16:13:52 -0400 Dennis Schridde > > <[EMAIL PROTECTED]> wrote: > >> Why that very bad programming style? Once you free pointer, how > >> else you know it free if no set to NULL? > > > >I usualy know that a pointer is invalid by setting it to NULL. > > Yes, so FREE(temp) is really free(temp) temp=NULL; > If you leave free(temp) without setting to NULL, then program never > knows it was free before. > I still no see why this bad programming style? If you need that pointer afterwards, you can set it to NULL. If you don't, just leave it alone.
> >> The malloc memory being > >> zero out is also standard from projects I have seen. > > > >Code that depends on variables to be initialized should do that > >itself. > > OK, this was just a nicer way I thinks, since use of memset is > faster than doing lots of assignment to 0 operations. Memset doesn't have to be called by a macro. You can call it yourself if you want to...
Description: This is a digitally signed message part.
_______________________________________________ Warzone-dev mailing list Warzoneemail@example.com https://mail.gna.org/listinfo/warzone-dev