Help with Arrays

May 11, 2013 at 7:59pm
Hello Guys.

Can you tell me what is the difference between an array and between
a done-dimensional array??!?!?
May 11, 2013 at 9:33pm
Well ARRAY is part or programming

And one - dimension array is part of ARRAY (int array[SIZE]);

Also there is multidimensional array,also part of ARRAY; (int array[SIZE][SIZE2] (Basically you can do everything with one -dimension ,because int array[5][6] = array[30])
May 11, 2013 at 9:47pm
You are wrong foxefde.

In your example an array that is int array[5][6]
that is in essence a 2d-array ( 2 dimensional ) basically its a x and y or column/row or you can think of it as 5 arrays that each have 6 elements
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//row
0
1
2
3
4
5
//columns
0 1 2 3 4 5

//so that is
0 1 2 3 4 5
1 x x x x x
2 x x x x x
3 x x x x x
4 x x x x x
5 x x x x x


and if you did array[30] that is a 1d array
and is just 1 array of 30 elements
and it would look like
1
2
3
4
//row
0
//collumn
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30


and you can have more than just 1 and 2d. You can have 3d- 4d ect...
basically a 3d array like int array[3][4][5]; would be 3 arrays that each contain 4 arrays with 5 elements in each

http://www.cplusplus.com/forum/articles/7459/


and back to the op question an array is the same as a one-dimensional array
Last edited on May 11, 2013 at 9:49pm
Topic archived. No new replies allowed.