Hello I\'m trying to use the std::copy() function to copy a two dimensional array. I was wondering if it\'s possible to do it like so! I keep getting a \"Segmentation Fault\"
std::copy(myint, myint+rows*columns,favint);
should be:
std::copy(&myint[0][0], &myint[0][0]+rows*columns,&favint[0][0]);
prototype of std::copy
:
template< class InputIt, class OutputIt >
OutputIt copy( InputIt first, InputIt last, OutputIt d_first );
Notice that pointer to array element could be wrapper as an iterator.