dimanche 14 mars 2021

C++ Replace part of an Array with another Array

I am beginner to C++ and I ran into a problem.

I have two arrays:

int first[10] = {1, 0, 9, 4, 2, 2, 3, 8, 0, 3};

int second[4] = {2, 2, 3, 4};

I want to replace the elements of first array from index 3 to index 6 with the elements of second array. How can I do this in C++?

Aucun commentaire:

Enregistrer un commentaire