Answers for "& before function arg in cpp"

C++
0

& before function arg in cpp

// pass 'x' by reference
void f1(int &x){
	...
}

// pass 'x' by value
void f2(int x){
	...
}
Posted by: Guest on February-28-2021

Browse Popular Code Answers by Language