#include #include using namespace std; void f(int copy, int *p); int main() { int i = 10; int j = 20; f(i, &j); //pass i by value, j by reference cout << "i == " << i << "\n" "&i == " << &i << "\n" << "j == " << j << "\n"; return EXIT_SUCCESS; } void f(int copy, int *p) { ++copy; //has no affect on i ++*p; //add 1 to j }