#include
int global_a = 10;
int increase(void)
{
return global_a += 10;
}
int global_a = 10;
int increase(void)
{
return global_a += 10;
}
int main(void)
{
printf("%d,%d\n", increase(), global_a);
}
And you compile it, what output would you expect? "20,10"? or "20,20"?
I was thinking "surely it is 20,20!". But this post says both are right! Wow.....
Note: the original poster was actually comparing GCC to TCC (Tiny C Compiler).
regards,
Mulyadi.
No comments:
Post a Comment