By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,220 Members | 1,600 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,220 IT Pros & Developers. It's quick & easy.

associativity

P: n/a
Which section(s) in the standard describe associativity rules?

e.g., *ptr++

* and ++ are the same precedence wise and as such
will be evaluated left-to-right?

--
nethlek
Nov 14 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ne*****@tokyo.com (Mantorok Redgormor) writes:
Which section(s) in the standard describe associativity rules?

e.g., *ptr++

* and ++ are the same precedence wise and as such
will be evaluated left-to-right?


Precedence and associativity are implicit in the C grammar, which
is scattered through section 6.5 "Expressions" (in C99). You can
also find the grammar rules gathered together (non-normatively)
in Annex A.
Nov 14 '05 #2

P: n/a
On 20 Jan 2004 14:32:08 -0800, ne*****@tokyo.com (Mantorok Redgormor)
wrote:
Which section(s) in the standard describe associativity rules?

e.g., *ptr++

* and ++ are the same precedence wise and as such
will be evaluated left-to-right?


While you are correct that * and ++ have the same precedence, the
associate right to left so the expression will be parsed as *(ptr++)
and not as (*ptr)++.
<<Remove the del for email>>
Nov 14 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.