#include using namespace std; //We can try replacing this by a macro: static void f(int& x, int& y){ x = 1; y = 2; } //This would be the macro (if it were not a comment): //#define f(x, y) {x = 1; y = 2;} int main(int argc, char **argv){ int a[2] = {10, 20}; int i = 0; f(i, a[i]); cout << i << endl; cout << a[0] << " " << a[1] << endl; return 0; }