Mail Archives: djgpp/1997/10/06/15:18:25
On 4 Oct 1997 22:34:31 GMT, firewind <firewind AT metroid DOT dyn DOT ml DOT org>
wrote:
> Michael Mauch <michael DOT mauch AT gmx DOT de> wrote:
> > sizeof is an (unary) operator, not a function, so
>
> > x = sizeof int;
>
> > is just as valid as
>
> > x = +4;
>
> Certainly not! Erik was correct; my lack of parenthesis around 'int' -was-
> a typo. Did you test code that does something like "x = sizeof int"? I
> garuntee that gcc will report:
>
> whatever.c:x: parse error before `int'
>
> Parenthesis are NOT required around a -variable- when the sizeof operator is
> applied, but they ARE required when it is being applied to a type name.
Yes, you're right. I didn't test it and `sizeof int´ really doesn't
work, whereas `char c; x = sizeof c;´ does. I'm sorry.
Regards...
Michael
- Raw text -