‣
#include <iostream>
using namespace std;
void changeValue(int a){
a = 1;
}
int main(){
int x = 0;
int y = 9;
changeValue(x);
cout << x + y;
}
9
#include <iostream>
using namespace std;
void changeValue(int &a){
a = 1;
}
int main(){
int x = 0;
int y = 9;
changeValue(x);
cout << x + y;
}
10
#include <iostream>
using namespace std;
void changeValue(int *a){
*a = 1;
}
int main(){
int x = 0;
int y = 9;
changeValue(&x);
cout << x + y;
}
10