[m]allocation question

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Wed Sep 26 13:44:31 AEST 1990


In article <UaxqffS00Vtq8akksB at andrew.cmu.edu> ghoti+ at andrew.cmu.edu (Adam Stoller) writes:
>         t = (struct node *) malloc(sizeof *t);

The argument of sizeof isn't evaluated. Only its type matters. This is
correct code, and perhaps easier to understand than the other obvious
version.

---Dan



More information about the Comp.std.c mailing list