例如
#include<stdio.h>
int foo = 100;
int bar()
{
int foo;
/* local foo = global foo, how to implemented? */
return 0;
}
int main()
{
int result = bar();
return 0;
}
我认为在函数栏中,直接调用 foo 只会得到全局 foo。我如何参考当地的 foo?我知道在 C++ 中有这个指针。但是,C 有类似的东西吗?
非常感谢!