0
what is swap?
2 Answers
+ 1
It just swaps two variables. You need to include the algorithm library ( #include <algorithm> ) in order to use it. For example, let's suppose that you want to swap a and b. You should call the function swap:
swap ( &a , &b );
or for some compilers
swap ( a , b );
Hope that helps.
+ 1
it means change the value of two number.
a=4
b=7
after swap
a=7
b=4