#include <stdio.h>
void f(int a, int b, int c)
{
printf("%p, %p, %p", (void*)&a, (void*)&b, (void*)&c);
}
int main(int argc, char* argv[])
{
int a = 0;
int b = 0;
int c = 0;
f(a, b, c);
return 0;
}
In windows, the result is in ascending order. However, in mac, the result is in descending order. I do not know why.
However, the result of code below is in decending order in mac os and windows os.
#include <stdio.h>
int main(int argc, char* argv[])
{
int a = 0;
int b = 0;
int c = 0;
printf("%p, %p, %p", (void *)&a, (void *)&b, (void *)&c);
return 0;
}
And, the results of code below are same in mac os and windows os: "ba".
#include <stdio.h>
void f(int a, int b)
{}
int main(int argc, char* argv[])
{
f(printf("a"), printf("b"));
return 0;
}