面试问题:不使用引用作为函数自变量或从函数返回值而更改局部变量值
void func()
{
/*do some code to change the value of x*/
}
int main()
{
int x = 100;
printf("%d\n", x); // it will print 100
func(); // not return any value and reference of x also not sent
printf("%d\n", x); // it need to print 200
}
Run Code Online (Sandbox Code Playgroud)
x 价值需要改变
c ×1