( ) in precedecene table refer to function call or parenthesis?

D

Deniz Bahar

The top level of C's precedence table has () next to [], I was
wondering what the () refers to. Some tables say in a footnote that ()
is for function calls not parenthesis, other tables say the exact
opposite.

Can someone clear up the confusion?
 
O

osmium

Deniz Bahar said:
The top level of C's precedence table has () next to [], I was
wondering what the () refers to. Some tables say in a footnote that ()
is for function calls not parenthesis, other tables say the exact
opposite.

Can someone clear up the confusion?

K& R say " The operator'()' refers to function call". They are very rarely
wrong about anything.
 
L

Luke Wu

osmium said:
Deniz Bahar said:
The top level of C's precedence table has () next to [], I was
wondering what the () refers to. Some tables say in a footnote that ()
is for function calls not parenthesis, other tables say the exact
opposite.

Can someone clear up the confusion?

K& R say " The operator'()' refers to function call". They are very rarely
wrong about anything.


The () of function calls are not operators. () refers to grouping
parenthesis.
 
J

jjf

Luke said:
osmium said:
Deniz Bahar said:
The top level of C's precedence table has () next to [], I was
wondering what the () refers to. Some tables say in a footnote
that () is for function calls not parenthesis, other tables say
the exact opposite.

K& R say " The operator'()' refers to function call". They are
very rarely wrong about anything.

The () of function calls are not operators.

Chapter and verse, please. Since the indexes of the C Standards call
them the "function-call operator" I suspect you're wrong.
 
L

Luke Wu

Luke said:
osmium said:
:

The top level of C's precedence table has () next to [], I was
wondering what the () refers to. Some tables say in a footnote
that () is for function calls not parenthesis, other tables say
the exact opposite.

K& R say " The operator'()' refers to function call". They are
very rarely wrong about anything.

The () of function calls are not operators.

Chapter and verse, please. Since the indexes of the C Standards call
them the "function-call operator" I suspect you're wrong.

http://www.difranco.net/cop2220/op-prec.htm
 
L

Lawrence Kirby

The top level of C's precedence table has () next to [], I was
wondering what the () refers to. Some tables say in a footnote that ()
is for function calls not parenthesis, other tables say the exact
opposite.

Can someone clear up the confusion?

They certainly refer to the function call operator, or else the table
would be incomplete. You could in addition view them as referring to
grouping parentheses, it depends on whether you consider those to be an
operator or not. It doesn't matter, you get the same results either way.
FWIW the standard does describe grouping parentheses in an operator like
way, in effect an identity operator whose result is the same as its
operand (the enclosed expression), with other properties of that
expression such as lvalue or function designator also being preserved.

Lawrence
 
J

jjf

Luke said:
Luke said:
osmium wrote:
:

The top level of C's precedence table has () next to [], I was
wondering what the () refers to. Some tables say in a footnote
that () is for function calls not parenthesis, other tables say
the exact opposite.

K& R say " The operator'()' refers to function call". They are
very rarely wrong about anything.

The () of function calls are not operators.

Chapter and verse, please. Since the indexes of the C Standards call
them the "function-call operator" I suspect you're wrong.

http://www.difranco.net/cop2220/op-prec.htm

Since when did some arbitrary web page define C? Can I prove you're
wrong by putting up a web page that says "The () of function calls
are operators"?

I'm more inclined to believe the indexes of the C Standards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top