-2
#‎include‬<stdio.h>
int main(void)
{
   int a=10;
   printf("%d, %d, %d\n", a, a++, ++a);
   return 0;
}

This is showing 12 11 12 in 32 bit gcc compiler and 12 11 11 in 16 bit turbo c compiler. Do differecnt C compilers have different argument passing rules?

Jens
  • 69,818
  • 15
  • 125
  • 179
Doonite
  • 15
  • 7
    and again this question...this is Undefined in C standard that why, different compilers use different order C don't give an order – Grijesh Chauhan Jul 21 '13 at 15:21
  • Please write "different" when you mean "different", `diff` is something very specific to programmers. It took way too long to understand your question. – Amadan Jul 21 '13 at 15:22
  • 1
    Why this one agaiiiiiin.......? Read [this](http://stackoverflow.com/questions/17250452/unexpected-behavior-of-printf) and also [this one](http://stackoverflow.com/questions/17473706/understanding-sequence-point-in-c) – haccks Jul 21 '13 at 15:26
  • 1
    In SO13 this question is defined as "possible duplicate, no answer required". The participants are allowed to whine and make snide remarks in comments. I hear they work on the SO14 draft which would require this question to result in demons actually flying out of poster's nose. – n. m. could be an AI Jul 21 '13 at 15:43
  • If I could set-up a filter for this question, I would -- can we delete this? It provides no useful information for users. – TheBlueCat Jul 21 '13 at 20:52

1 Answers1

1

Please read the comp.lang.c FAQ, Expressions.

Q: Under my compiler, the code

int i = 7; printf("%d\n", i++ * i++);

prints 49. Regardless of the order of evaluation, shouldn't it print 56?

Jens
  • 69,818
  • 15
  • 125
  • 179