Home > DeveloperSection > Forums > how can we make a function for swamping using template in C plus plus?
Kate Smith
Kate Smith

Total Post:24

Points:168
Posted on    June-13-2013 7:53 AM

 Visual C++ Visual C++ 
Ratings:


 1 Reply(s)
 661  View(s)
Rate this:
Hi,

How can we make a function for swamping using template in c++? 

Thanks in advance for any recommendations or solutions.


AVADHESH PATEL

Total Post:604

Points:4228
Posted on    June-14-2013 1:55 AM

Hi Kate,

try this:

template <class X)
void swapargs(X &a,X &b)
{
X temp;
temp=a;
a=b;
b=temp;

Don't want to miss updates? Please click the below button!

Follow MindStick