void swap(int &first,int &second){ int temp = first; first = second; second = temp; }
int a=3,b=2; swap(a,b);
void swap(int *first,int *second){ int temp = *first; *first = *second; *second = temp; } int a=3,b=2; swap(&a,&b);
#define swap(a,b){ \ int _temp = (a); \ (a) = _b; \ (b) = _temp; \ }