a++是后加运算,所以也就是说要在a输出执行完成后才会对a执行加一运算
别听这烂书瞎说,实践出真知
你这本书可以烧了,拿这种破代码误人子弟。C/C++语言没有规定运算符操作数的计算顺序,编译器可能按任意顺序来计算操作数的值以及伴随的side-effect,因此在同一个表达式里多次修改同一个变量是undefined behaviour,在不同编译器上得到的结果可能不一样。
From https://en.cppreference.com/w/c/language/eval_order
Order of evaluation
Order of evaluation of the operands of any C operator, including the order of evaluation of function arguments in a function-call expression, and the order of evaluation of the subexpressions within any expression is unspecified (except where noted below). The compiler will evaluate them in any order, and may choose another order when the same expression is evaluated again.
不一定啊,因编译器而异,我估计vs的编译器和gcc就不一样
别瞎说,并不是说优先级高就先算,而是说优先级高的结合性高,而他们的计算顺序还是按设定的从左往右或者从右往左进行计算的,望采纳