标签:str name using code 引用 class void ace swa
/* 引用作为变量的别名,在一些场合可以代替指针 */ #include <iostream> using namespace std; void swap(int& a, int& b) { int t = a; a = b; b = t; } int main() { int a = 1; int b = 2; swap(a, b); cout << "a = " << a << endl << "b = " << b << endl; }
标签:str name using code 引用 class void ace swa
原文地址:https://www.cnblogs.com/kenantongxue/p/10421096.html