S
sam
int i=0;
printf("%d %d %d %d",++i,++i,++i,++i);
output:
4 3 2 1
why is not
1 2 3 4
printf("%d %d %d %d",++i,++i,++i,++i);
output:
4 3 2 1
why is not
1 2 3 4
sam said:int i=0;
printf("%d %d %d %d",++i,++i,++i,++i);
sam said:int i=0;
printf("%d %d %d %d",++i,++i,++i,++i);
output:
4 3 2 1
why is not
1 2 3 4
sam said:int i=0;
printf("%d %d %d %d",++i,++i,++i,++i);
output:
4 3 2 1
why is not
1 2 3 4
Bruno Desthuilliers said:AFAIK, the evaluation order of a function's args is
implementation-dependant (at least this is what I read in my K&R2).
In said:Or entirely undefined, as in this case.
sam said:int i=0;
printf("%d %d %d %d",++i,++i,++i,++i);
output:
4 3 2 1
why is not
1 2 3 4
^^^^^^^Martin Ambuhl said:Please check the FAQ before posting. Then you would know that your
question is old, tired, and more than adequately answered already -- in
countless threads started by other people as clueless as you, as well as in
the the FAQ.
Martin said:Please check the FAQ before posting.
Then you would know that your question is old, tired
and more than adequately answered already --
in countless threads started by other people as clueless as you,
as well as in the the FAQ.
Bruno said:AFAIK, the evaluation order of a function's args is
implementation-dependant (at least this is what I read in my K&R2).
Bruno Desthuilliers said:sam said:int i=0;
printf("%d %d %d %d",++i,++i,++i,++i);
output:
4 3 2 1
why is not
1 2 3 4
[laotseu@localhost dev]$ gcc -Wall -ansi -pedantic -oorder order.c
order.c: In function `main':
order.c:6: warning: operation on `i' may be undefined
order.c:6: warning: operation on `i' may be undefined
order.c:6: warning: operation on `i' may be undefined
AFAIK, the evaluation order of a function's args is
implementation-dependant (at least this is what I read in my K&R2).
Please cite and quote the relevant FAQ.
E. Robert Tisdale said:Please cite and quote the relevant FAQ.
Mark A. Odell said:
In said:Please cite and quote the relevant FAQ.
I suggest you are better off ignoring Trollsdale unless he gives
his usual erroneous advice. The above is a pure troll, and won't
lead anyone astray.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.