Skip to the content of the web site.

Project W.8: Concatenate

This function takes two arrays and concatenates their entries into a single array, where the entries of the first array appear first and the entries of the second array appear second. If either capacity is zero, the pointer passed may be nullptr.

Integer implementation

int *concatenate( int array_1[], std::size_t capacity_1,
                  int array_2[], std::size_t capacity_2 );

Templated implementation

template <typename T>
T *concatenate( T array_1[], std::size_t capacity_1,
                T array_2[], std::size_t capacity_2 );