yah i know now but what if i wanna count like row by row like
{1,3,4} {3,5,6} it will count 1 + 3 and 3+5 and 6 + 4 ?
should i switch variables x first then i 2nd ?
Hello MrNoob,
Look at my example cleary i hope u can get the thing now.
A)a[2][3] means 2 array elements which contain 3 values each.
e.g: {a,b,c } {d,e,f}
B)a[2][3][4] : 2 array elements of type a[3][4]
so 1st break:
a[3][4] example:
{a,b,c,d},{a,b,c,d},{a,b,c,d}
c)so a[2][3][4] means 2 elements of kind a[3][4]
means
e.g
{{a,b,c,d},{a,b,c,d},{a,b,c,d} },{{a,b,c,d},{a,b,c,d},{a,b,c,d} }
D)As the way your break assgin indexes like that.and find out individual value by like
a[0][][]
a[1][][]
CONENTRATE ON THE BELOW EXAMPLE:
==================================
1)lets say
a[2][3][4]={{a,b,c,d},{a,b,c,d},{a,b,c,d} },{{a,b,c,d},{a,b,c,d},{a,b,c,d}}
2)break like:
a[0][3][4]={{a,b,c,d},{a,b,c,d},{a,b,c,d}
a[1][3][4]={{a,b,c,d},{a,b,c,d},{a,b,c,d}
3)now like this:
a[0][0][4]={a,b,c,d}
a[0][1][4]={a,b,c,d}
a[0][2][4]={a,b,c,d}
4)now like this:
a[0][0][0]='a';
a[0][0][1]='b';
a[0][0][2]='c';
a[0][0][3]='d';
Now i guess u can how to break.
RULE: break from left to right.
5)After you can clearly visualize the array you decide what u need to do then
adjust your loop variable like that.
Writing a code is not the thing,its what u understand before writing the code is important.