mirror of
https://github.com/happyflyer/wangdao-data-structure.git
synced 2026-02-03 02:24:39 +08:00
16 lines
249 B
C++
16 lines
249 B
C++
#include <stdio.h>
|
||
|
||
void test(int &x)
|
||
{
|
||
x = 1024;
|
||
printf("test 函数内部:x = %d\n", x);
|
||
}
|
||
|
||
int main()
|
||
{
|
||
int x = 1;
|
||
printf("调用 test 函数前:x = %d\n", x);
|
||
test(x);
|
||
printf("调用 test 函数后:x = %d\n", x);
|
||
}
|