I read somewhere that the parameters of functions are evaluated right >>
to left but it all depends on the compiler. Therefore, does this mean
that the output of this program is "undefined" meaning there is no
definite answer!
#include <stdio.h>
void fun(int, int);
int main()
{
int i = 5;
fun(--i, i++);
fun(++i, i--);
printf("From Main: %d\n", i++);
return 0;
}
void fun(int x, int y)
{
printf("From Function: %d %d\n", x++, y--);
}
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,064 |
Nodes: | 10 (0 / 10) |
Uptime: | 148:07:30 |
Calls: | 13,691 |
Calls today: | 1 |
Files: | 186,936 |
D/L today: |
33 files (6,120K bytes) |
Messages: | 2,410,932 |