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: | 913 |
Nodes: | 10 (1 / 9) |
Uptime: | 188:18:52 |
Calls: | 12,143 |
Calls today: | 2 |
Files: | 186,515 |
Messages: | 2,231,605 |