Possible Duplicate:
Is this undefined C behaviour?
#include<stdio.h>
int main()
{
int a=5;
printf("%d %d %d",a++,a++,++a);
return 0;
}
Output:
In gcc:
7 6 8
In TURBO C:
7 6 6
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because the order of evaluation of arguments to a function is unspecified and may vary from compiler to compiler. An compile may evaluate function arguments from:
left to right or
right to left or
in any other pattern.
This order is not specified by the C standard.
Reference:
C99 Standard 6.5