Question: describe and write a c++ function Swap that takes parameters x and y,and swaps the values of the two parameters (meaning it assigns the value
describe and write a c++ function "Swap" that takes parameters x and y,and swaps the values of the two parameters (meaning it assigns the value of x to y and the value of y to x).Note that the types of x and y are the same but the type is a generic type.Therefore,you must use template to write the swap function that can accept any type of parameters.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
