You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int a = 10;
int b = 20;
swap1(a, b); // 值传递不会改变实参
swap2(&a, &b); //地址传递会改变实参
cout << "a = " << a << endl;
cout << "b = " << b << endl;
system("pause");
return 0;
}修改成这样子会不会更好点呢?int main() {
int a = 10;
int b = 20;
swap1(a, b); // 值传递不会改变实参
cout << "swap1 a = " << a << endl;
cout << "swap1 b = " << b << endl;
swap2(&a, &b); //地址传递会改变实参
cout << "swap2 a = " << a << endl;
cout << "swap2 b = " << b << endl;
system("pause");
return 0;
}`
The text was updated successfully, but these errors were encountered:
`int main() {
}
修改成这样子会不会更好点呢?
int main() {}`
The text was updated successfully, but these errors were encountered: