...

/

Templated mySwap( ) Function

Templated mySwap( ) Function

Learn to create a templated function that works on four different data types.

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 ...