Implement two functions that swap the values of two integers using different parameter-passing mechanisms in C++.
void swapPtr(int* a, int* b);
Swaps the values pointed to by a and b using pointers.
void swapRef(int& a, int& b);
Swaps the values of a and b using references.
The main() function will:
You only need to implement the two swap functions.
Constraints & Notes
Example 1
Input
5 10Output
After swapPtr: a=10 b=5
After swapRef: a=10 b=5
Example 2
Input
-3 7Output
After swapPtr: a=7 b=-3
After swapRef: a=7 b=-3
Input
5 10
Expected Output
After swapPtr: a=10 b=5 After swapRef: a=10 b=5