swap() in C++
The swap() is a built-in function in the C++ STL which swaps the value of two variables. This function supports almost every data type available in C++, whether it is a primitive type such as int, char, etc. or an STL containers such as vector, map, etc.Example:C++#include <iostream> #include