1. arrays problem

i need to resample a 2d array in blocks of 8 X 8.
to be more elaborate

@ Zuk
i am sorry i made mistake.. it looks like this now ..

Code:
``` let
a[40][40];
then i want to get
b{ [5][5], [5][5],. . . . .,[5][5] ,
[5][5], [5][5],. . . . .,[5][5] ,
.
.
.
[5][5], [5][5],. . . . .,[5][5] }

ie (eight rows and columns  of [5][5] ) ie =64

first  [5][5] array should  contain  a[0][0] to a[5][5]
elements of the array a[40][40].
second [5][5]  array should  contain  a[6][6] to a[10][10]elements of the array a[40][40].
and so on```
@ SlyMaelstrom:
you are right , i mean this : 40* 40 equlas (5*5)*(8*8)
the matrix b will be a matrix of 8 by 8 blocks while each block is 5 X 5.

can any body please sort out the problem ..
thanks

2. Guess you have to know yourself from where to where you want to put your elements. I can just say it will be hard to put 64 elements ( [0][0]..[7][7] ) into an array with 25 elements.
Kurt

3. It's also worth mentioning that:

40 x 40 does not equal 5 x 5 x 8.

If you want to break down a 40 by 40 array into 5 by 5 arrays, you'll need 64 of them.

4. the matrix b will be a matrix of 8 by 8 blocks while each block is 5 X 5.
You sound like you're trying to make an array of arrays.
That's usually not a good idea. You could theoretically do this with a four dimensional array or a three dimensional array. Something like:

int Array[5][5][8][8];

This would (I'll try to make this easy to visualize) create something that could be seen as 8 3D boxes with the dimensions of 5x5x8 units. Or in otherwords... the 3D array of:

int Array[5][5][64];

Now to convert a [40][40] array into that is just a matter of knowing how you want to break the array down. Anyway I look at this, it doesn't seem like something I'd ever want or need to do.