N
nitsnow
#include <stdio.h>
int g = 1;
int func_2()
{
g = 2;
return 3;
}
int main()
{
int *l = &g;
*l = func_2(); /* LHS evaluates to g, and
RHS writes to g */
printf("g = %d\n", g);
return 0;
}
My colleague and I had a lengthy discussion, and nobody can be
convinced by the other. The question is: can g ever gets the value of
2 at the end of the program?
Appreciate your expert thoughts...
Jason
int g = 1;
int func_2()
{
g = 2;
return 3;
}
int main()
{
int *l = &g;
*l = func_2(); /* LHS evaluates to g, and
RHS writes to g */
printf("g = %d\n", g);
return 0;
}
My colleague and I had a lengthy discussion, and nobody can be
convinced by the other. The question is: can g ever gets the value of
2 at the end of the program?
Appreciate your expert thoughts...
Jason