C++ concatenate two int arrays into one larger array
Use std::copy defined in the header <algorithm>. The args are a pointer to the first element of the input, a pointer to one past the last element of the input, and a pointer to the first element of the output. ( https://en.cppreference.com/w/cpp/algorithm/copy ) int * result = new int[size1 + size2]; std::copy(arr1, arr1 + size1, … Read more