| <<< What is array name ? | Index | Pseudo-random numbers >>> |
#include <iostream>
#include <algorithm> // STL algoritms
#include <iterator> // for std::ostream_iterator
int main()
{
const int SIZE = 5;
int iarr[ SIZE ] = { 1, 2, 3 };
int dummy[ SIZE ] = { 0 };
std::copy( // Copy elements from iarr to dummy
iarr,
iarr + SIZE,
dummy
);
std::copy( // Display elements of dummy array
dummy,
dummy + SIZE,
std::ostream_iterator< int >( std::cout, "\t" )
);
return 0;
}
/* Program output:
1 2 3 0 0
*/
| <<< What is array name ? | Index | Pseudo-random numbers >>> |