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:
main()
You only need to implement the two swap functions.
Constraints & Notes
Example 1
Input
5 10
Output
After swapPtr: a=10 b=5 After swapRef: a=10 b=5
Example 2
-3 7
After swapPtr: a=7 b=-3 After swapRef: a=7 b=-3
Test Cases
Test Results
Expected Output