Re:What is your favourite C programming trick?
by decklin on Friday October 14, 2011 @07:23PM
(#3113373)
Also, sizeof is an operator, not a function, so you can write that as
[ Parent
| on HN ]
Re:What is your favourite C programming trick?
by tkahn6 on Friday October 14, 2011 @08:59PM
(#3113621)
This is true but there is a qualifier here:
If a type name is used, it always needs to be enclosed in parentheses, whereas variable names and expressions can be specified with or without parentheses.
So
long_struct_name *foo = malloc(sizeof long_struct_name)
won't compile.