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: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 403 |
Nodes: | 16 (2 / 14) |
Uptime: | 16:48:22 |
Calls: | 8,482 |
Calls today: | 4 |
Files: | 13,187 |
Messages: | 5,912,961 |