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,123 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 34:43:50 |
| Calls: | 14,371 |
| Files: | 186,380 |
| D/L today: |
1,067 files (304M bytes) |
| Messages: | 2,540,617 |