how can we make a function for swamping using template in C plus plus?

Total Post:24

Points:168

 1234  View(s)
Ratings:
Rate this:
Hi,

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

Thanks in advance for any recommendations or solutions.
  1. Re: how can we make a function for swamping using template in C plus plus?

    Hi Kate,


    try this:

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

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.