摘要:Associativity RulesThe associativity rules of a language specify which operator is evaluated first when two operators with the same precedence are adjacent in an expression.当一个表达式中有两个相同优先级的操作符相邻时,结合律规定了哪个操作符先进行操作。[例]x = 3 + 2 - 1;因为这里的加(+)操作符和减(-)操作符优先级相同,而+、-的结合律都是从左向右的,所以先执行加法,后执行减法,所以x的结果为4。[参考资料 阅读全文
posted @ 2012-02-25 12:00 UniMouS 阅读 (833) 评论 (1) 编辑

版权所有 © 2011-2012 方一曙

Copyright © 2011-2012 Fang Yishu (UniMouS)