任何人都可以告诉我如何访问另一个函数中的函数声明和定义的变量.例如
void function1() { string abc; } void function2() { I want to access abc here. }
怎么做?我知道使用参数,我们可以做到这一点,但还有其他方法吗?
c++ scope
c++ ×1
scope ×1