60 636
Assignments Done
97,8%
Successfully Done
In April 2018

Answer to Question #49849 in C++ for mishal

Question #49849
write a program to swap two values by passing pointer as arguments to the function.
Expert's answer
///////////////////////////////////////////
template <typename T>
void swap(T* left, T* right)
{
    T temp = *(left);
    *(left) = *(right);
    *(right) = temp;
}

///////////////////////////////////////////


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Assignment Expert
15.12.14, 21:02

Dear mishal,

You're welcome. We are glad to be helpful. If you liked our service please press like-button beside answer field. Thank you!

mishal
15.12.14, 12:38

thank u so much!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions