ARRAY TRANSFER

ARRAY1
1 2 3 4 5
10 9 8 7 6

ARRAY2
0 0
0 0
0 0
0 0
0 0
--------
Transferring to
10 1
9 2
8 3
7 4
6 5
1
2
3
4
5
6
7
8
#include <iostream>
using namespace std;
void main()
{
  int Array2d1, Array2d2;


}


I dont know how to set the sizes of arrays to 2x10
Can someone show me the near program to this?
Last edited on
1
2
3
int size_x = 2;
int size_y = 5;
int 2D_Array[size_x][size_y];


There is your 2D array.

to fill it up you need to loop through the outer array while looping through each components inner array.

1
2
3
for (int i = 0; i < size_x; i++)
       for int j = 0; j < size_y; j++)
             // access the array with 2D_array[i][j] 
Topic archived. No new replies allowed.