jeudi 21 mars 2019

How do I add 10 arrays to a single array in c++?

Let's say I have these 10 previously declared arrays in my code.

  int arr1[] = {1,2,3,4,5,6,7,8,9,10};
  int arr2[] = {1,2,3,4,5,6,7,8,9,10};
  int arr3[] = {1,2,3,4,5,6,7,8,9,10};
  int arr4[] = {1,2,3,4,5,6,7,8,9,10};
  int arr5[] = {1,2,3,4,5,6,7,8,9,10};
  int arr6[] = {1,2,3,4,5,6,7,8,9,10};
  int arr7[] = {1,2,3,4,5,6,7,8,9,10};
  int arr8[] = {1,2,3,4,5,6,7,8,9,10};
  int arr9[] = {1,2,3,4,5,6,7,8,9,10};
  int arr10[] = {1,2,3,4,5,6,7,8,9,10};

Basically, I want to add all 10 of these arrays to one single array and create an array of arrays.

How would I go about doing this? This question might seem trivial for some, but I'm new to C++ and can not figure out how to do it. Please help and thanks in advance.

Aucun commentaire:

Enregistrer un commentaire