parens around sizeof arg
g-frank at gumby.UUCP
g-frank at gumby.UUCP
Wed Feb 27 15:52:32 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...
>
I rest my case.
--
Dan Frank
Q: What's the difference between an Apple MacIntosh
and an Etch-A-Sketch?
A: You don't have to shake the Mac to clear the screen.
More information about the Comp.lang.c
mailing list