T
Tinkertim
Hi,
I have often wondered if casting the return value of malloc() (or
friends) actually helps anything, recent threads here suggest that it
does not .. so I hope to find out.
For instance :
char *tmp = NULL;
tmp = (char *) malloc(1024);
Is there any pointing in casting the return value of malloc? I see
many people do that, but not test the result such as :
if (tmp == (char *) NULL)
.. some code about malloc() failing ...
Is there any point in casting it?
Cheers,
--Tim
I have often wondered if casting the return value of malloc() (or
friends) actually helps anything, recent threads here suggest that it
does not .. so I hope to find out.
For instance :
char *tmp = NULL;
tmp = (char *) malloc(1024);
Is there any pointing in casting the return value of malloc? I see
many people do that, but not test the result such as :
if (tmp == (char *) NULL)
.. some code about malloc() failing ...
Is there any point in casting it?
Cheers,
--Tim