A defined macro to copy selected values of std::vector to an array using std::copy
Basically, there are very few places in C++ where you want to use Macros. A lot of old C code used function-like macros because of performance reasons - calling a function requires creating a new stack frame. They were also used to get away from C's type system. With C++, inline functions and templates remove the need for this 99% of the time.

template &lt;typename T&gt;
inline void copy_vector_to_array(const std::vector&lt;T&gt;&amp; vec, 
                                 std::size_t position, 
                                 std::size_t length, 
                                 T* array)
{
    std::copy(vec.begin() + position, vec.begin() + position + length, array);
}


In C++11, we can do better still - an erroneous length passed in above will cause problems, and will be hard to detect:

#include &lt;vector&gt;
#include &lt;array&gt;
#include &lt;iterator&gt;
#include &lt;cassert&gt;

template &lt;typename T, std::size_t N&gt;
inline void copy_vector_to_array(const std::vector&lt;T&gt;&amp; vec, 
                                 std::size_t position, 
                                 std::size_t length, 
                                 std::array&lt;T, N&gt;&amp; array)
{
    assert(length &lt;= N);
    std::copy(std::begin(vec) + position, std::begin(vec) + position + length, 
              std::begin(array));
}


This will be just as efficient as the macro version, however, we also gain type safety, as well as (easy) bounds checking. 

We can also improve on it. So that it handles other container types:

template &lt;typename C, std::size_t N&gt;
inline void copy_container_to_array(const C&amp; container, 
                                 std::size_t position, 
                                 std::size_t length, 
                                 std::array&lt;typename C::value_type, N&gt;&amp; array)
{
    assert(length &lt;= N);
    std::copy(std::next(std::begin(vec), position), std::next(std::begin(vec), position + length), 
              std::begin(array));
}