#include // cout, endl #include // EXIT_SUCCESS void Foo(int& x, int* y, int z) { z = *y; x += 2; y = &x; } int main(int argc, char** argv) { int a = 1; int b = 2; int& c = a; Foo(a, &b, c); std::cout << "(" << a << "," << b << "," << c << ")" << std::endl; return EXIT_SUCCESS; }