如何后递增和放大器; pre增量都在函数的参数评估? [英] How post-increment & pre-increment both are evaluated in function argument?

查看:131
本文介绍了如何后递增和放大器; pre增量都在函数的参数评估?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  职位和pre增量在C 结果
  未定义行为和顺序点

在这里,我想知道为什么这个输出来?
任何一个可以解释我在所有适当的方式

here i want to know why this output comes?? Any one Can Explain me All in proper manner

#include<stdio.h>
   int main() {
   int a=5;
   printf("%d %d %d",a++,a++,++a);
   return 0;
   } 

该程序的输出是像

在LINUX
 7 6 8

In LINUX 7 6 8

推荐答案

这是不确定的 - 副作用,只在guarantied的序分

It's undefined - side effects are only guarantied to be completed at sequence points.

这篇关于如何后递增和放大器; pre增量都在函数的参数评估?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆