C里,得自己declare 一个global mythis pointer指向global foo。
#include
int foo = 100;
int * mythis=&foo;
int bar()
{
int foo;
/* local foo = global foo, how to implemented? */
foo=*mythis;
return 0;
}
z****e 发帖数: 2024
3
The C++ way
foo=::foo;
a****l 发帖数: 8211
4
why do you want to give them the same name? Is it confusing? Or maybe that's
the purpose?