Object Oriented Programming20755 marksFunction templates
Create a function called swaps() that interchanges the values of the two arguments sent to it (pass these arguments by reference), make the function into a template, so it can be used with all numerical data types (char, int, float, and so on), write a main() program to exercise the function with se
Create a function called swaps() that interchanges the values of the two arguments sent to it (pass these arguments by reference), make the function into a template, so it can be used with all numerical data types (char, int, float, and so on), write a main() program to exercise the function with several types. [5]
A function template allows writing a single generic function that works with multiple data types. The compiler automatically generates the appropriate version of the function for each data type used. Syntax: Passing arguments by reference (using &) means the function works directly on the origina...