parens around sizeof arg

Thomas M. Breuel tmb at talcott.UUCP
Tue Feb 26 05:22:54 AEST 1985


> > That's a "sizeof(type)", not a "sizeof thing", and the parentheses are
> > necessary in that case.
> 
>    Oh, how nice.  Something else for experts in C to know so they can feel
> superior to the novices.  Never have one, consistent way to use a language 
> construct when you can have two to demonstrate your mastery of the arcana.

Well, you can think about 'sizeof' this way: it only allows you to take
the size of an object. To get the size of a type, you have to cast an
object to that type. As a notational convenience, the 'C' compiler
allows you to leave out the object that you are casting...

							Thomas.



More information about the Comp.lang.c mailing list