You can use the copy algorithm but it does almost the same thing. It's just shorter to call.
On the reference page you can see a sample implementation of std::copy. You can try to apply it on your code http://www.cplusplus.com/reference/algorithm/copy/