Re: Help with understanding this please
- From: Richard<rgrdev@xxxxxxxxx>
- Date: Sat, 30 Aug 2008 17:20:33 +0200
Richard Heathfield <rjh@xxxxxxxxxxxxxxx> writes:
mdh said:
On Aug 30, 7:11 am, Richard Heathfield <r...@xxxxxxxxxxxxxxx> wrote:
mdh said:
struct t_node_n{
char *word;
int match;
struct t_node_n *left;
struct t_node_n *right;
};
struct t_node_n *temp = (struct t_node_n *) malloc(sizeof(struct
t_node_n));
Better: struct t_node_n *temp = malloc(sizeof *temp);
Cleaner, tighter, less maintenance hassle.
Richard...before I rest so that sleep can be calm!!, may I ask why you
have not cast the return from malloc to type "struct t_node n *).
Why on earth would I do that? What good could it possibly do?
Yeah because C++ is wrong and so was pre Ansi C.
Streuth.
.
- Follow-Ups:
- Re: Help with understanding this please
- From: Malcolm McLean
- Re: Help with understanding this please
- References:
- Re: Help with understanding this please
- From: Richard Heathfield
- Re: Help with understanding this please
- From: mdh
- Re: Help with understanding this please
- Prev by Date: Re: Help with understanding this please
- Next by Date: Re: Help with understanding this please
- Previous by thread: Re: Help with understanding this please
- Next by thread: Re: Help with understanding this please
- Index(es):
Relevant Pages
|