void swap(int& a, int& b) { int temp = a; a = b; b = temp; }
Call by reference through reference parameters is not available in C or Java.