int x=10; printf("%d %d",x,x++); 的输出是 11 10 ,为什么

难道printf是从右往左执行?
2025-06-28 21:41:17
推荐回答(1个)
回答1:

printf内参数运算顺序C++语言标准没有进行定义,所以具体结果依赖于具体的编译器实现,讨论其取值没有意义,详见C++标准

unspecified behavior
The order in which the function designator, arguments, and subexpressions within the arguments are evaluated in a function call