Question: Use C++ Write a swap() function that takes pointers to two integer variables as parameters and swaps the contents in the variables using pointers and
Write a swap() function that takes pointers to two integer variables as parameters and swaps the contents in the variables using pointers and without creating any extra variables or pointers. The swapped result should be displayed from the main(). Demonstrate the function in your program. Your function prototype looks like this: void swap(int*, int*)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
