一.运算符的优先级 在C++ Primer一书中,对于运算符的优先级是这样描述的: Precedence specifies how the operands are grouped. It says nothing about the order in which the operands are evaluated. 意识是说优先级规定操作数的结合方式,但并未说明操作数的计算顺序。举个例子: 6+3*4+2 如果直接按照从左到右的计算次序得到的结果是:38,但是在C/C++中它的值为20。 因为乘法运算符的优先级高于加法的优先级,因此3是和4分组到一起的,并不是6与3进行分组。这就是运算符 Read More
posted @ 2012-09-06 13:42 玄色青春 Views(246) Comments(0) Diggs(0)