// pass by value, reference, and pointer #include void swap0(int first, int second) // caution: this function does not work! { int temp = first; first = second; second = temp; } void swap(int& first, int& second) { int temp = first; first = second; second = temp; } void swap(int* first, int* second) { int temp = *first; *first = *second; *second = temp; } void main() { int i = 7; int j = 8; swap0(i,j); cout << i << j << endl; swap(i,j); cout << i << j << endl; swap(&i,&j); cout << i << j << endl; }