tags:

views:

126

answers:

3

How are arithmetic expression evaluated in The C language? How can I understand the Operator priority?

+16  A: 

I think this table can help you.

BTW, have you ever heard of Google?

Also, this answer might be of interest.

klez
+3  A: 

This Wikipedia entry might help: http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B

As a side-note: the term "operator precedence" is used more commonly than "operator priority" and might lead to more useful search hits in your favorite search engine.

Greg S
"favorite search engine" which is not google i guess. Google returns precedence for priority.
Praveen S
@Praveen: for what it's worth, the C standard uses "operator precedence".
Greg S
@Greg S: Yeah that's rite. It was for the one who asked the question. Wonder why it isn't closed yet.
Praveen S
@Praveen because it is indeed a question, it isn't subjective and argumentative and it isn't off-topic. It's just trivial.
klez
+1  A: 

The wikipedia page that Greg S linked to is a good reference.

More generally, any time you have questions about the C language, you can always read the standard. It's generally pretty well written and clear; once you've skimmed through it, you'll know where to find answers to questions as they come up.

Stephen Canon
Brian Hooper
Stephen Canon
Good point. It doesn't seem so very long ago that C was the Latest Thing.
Brian Hooper