<<< Transform algoritm example | Index | Array as Function Argument >>> |
#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 ] << '\n' ; return 0; } /* Program output: 5 1 */
<<< Transform algoritm example | Index | Array as Function Argument >>> |