Templated mySwap( ) Function
Learn to create a templated function that works on four different data types.
We'll cover the following...
Problem
Write a template function, myswap( )
, that interchanges the contents of two variables. Use it to swap integers, floats, long integers, and strings.
Can this function be given a name swap( )
instead of myswap( )
?
Sample run
Suppose x
...