#include <iostream> #include <algorithm> int main() { int dummy[] = { 1, 2, 3, 4, 5 }; // Swap elements: std::swap( dummy[ 0 ], dummy[ 4 ] ); // Display elements of dummy array: std::cout << dummy[ 0 ] << '\t' << dummy[ 4 ] ; return 0; }