Re: Operator precedence: am I missing something?



Jun Woong writes:
Kevin D. Quitt <KQu...@xxxxxxxxxx> wrote:
Why does the Standard not have an explicit table that shows the precedence
of operators? A web search provides numerous tables, mostly but not
entirely in agreement with one another.

Or am I missing something obvious?

The precedence table does not convey all information that the
grammar does. Open one of your C books and see whether the cast
operator has lower precedence than the unary sizeof, + and -
operators or has the same one as they do: (...)

What of it? So all the operators should not be stuffed into a single
precedence table, since that too easily gets misleading. And additional
info like associativity is needed too. On the other hand, a few partial
precedence tables would still be quite useful. But on the gripping
hand, if you are looking for a good C reference that's what C reference
books are for, not standards.

--
Regards,
Hallvard
.



Relevant Pages

  • Re: Operator precedence: am I missing something?
    ... The precedence table does not convey all information that the ... Open one of your C books and see whether the cast ... the associativity is represented as direction (to left ... Jun, Woong ...
    (comp.std.c)
  • Re: order of precedence
    ... Google Books are authoritative, and probably weren't in their time, ... I found one more book listing English, Scottish, and Iresh Barons, ... was a different precedence for Scottich Barons. ...
    (rec.heraldry)
  • Re: Is this C program doing what it is supposed to do ?
    ... to emphasize *precedence* is pretty common in the teaching and books ...
    (comp.lang.c)
  • Re: do while: most elegant or efficient
    ... because I can't always remember the precedence. ... about expressions like call sub(a .AND_THEN. ... If you think functional notation unclutters, ... > merge (even though the reference isn't needed!). ...
    (comp.lang.fortran)
  • Re: c = foo(--a) + a; ?
    ... Seebs wrote: ... See this on how expression is evaluated on precedence. ... Don't rely on Microsoft's site to tell you about the language. ... This reference explains the C++ programming language as implemented ...
    (comp.lang.c)