[Discuss] Casting the return value of malloc bad?
Andrew Resch
andrewresch at gmail.com
Tue Jul 11 22:53:51 PDT 2006
This link seems to explain it:
http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1047673478&id=1043284351
Basically, there is no need and it will just cause problems if you decide to
change the type of pointer.
On 7/11/06, Adam Parkin <pzelnip at telus.net> wrote:
>
> Okay a question for the C gurus on the list: I've heard from a few
> people that casting the return value from malloc is bad practice, is
> this true, and if so, why? And more importantly, if it is bad practice,
> then what is a better practice (and why)?
>
> --
> Adam Parkin
> E-mail: pzelnip at telus.net
> ----------------------
> To an optimist the glass is half-full.
> To a pessimist the glass is half-empty.
> To a computer scientist the glass is twice as big as it needs to be.
>
> _______________________________________________
> Discuss mailing list
> Discuss at vlug.org
> http://ladybug.vlug.org/cgi-bin/mailman/listinfo/discuss
>
More information about the Discuss
mailing list