You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
176 B
21 lines
176 B
2 years ago
|
//6.2.2传引用参数
|
||
|
|
||
|
#include <iostream>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
void a(int &i);
|
||
|
|
||
|
int main(){
|
||
|
int x=12;
|
||
|
|
||
|
a(x);
|
||
|
cout << x << endl;
|
||
|
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
void a(int &i){
|
||
|
i=111;
|
||
|
}
|