#include void foo(int& x, int y){ y = x; x = 42; } int main(){ int x, y; x = 9; y = 27; foo(y, x); printf("%d %d\n", x, y); return 0; }