1. ## pointer to matrix

Say I have a matrix (that is of dimension DIM) of shorts called m1 and I want to split it into 4 (2 by 2)'s:

I need a pointer that will point to the short in

m1[0][dim/2]

I have tried the following:

short **B=&(m1[0][dim/2]);

// B is supposed to point to the short in m1[0][dim/2].
// m1 was passed into the function through its address as a
// short ***

I tried to check if B is pointing in the correct spot by doing this:

printf("%d ",B[0][0]);

This however prints out an incorrect value. Any suggestions?

2. This is how i would do it..

Code:
```main(void){

short numbers[10][MAX_ROWS]={0};

/* pointer to a 2d array.  You must express how many dims there are */
short (*pNumbers)[MAX_ROWS] = NULL;

/* asign numbers to pointer to array */
pNumbers= numbers;

/* using the pointer */
pNumbers[9][9] = 9998;

/* using none pointer */
numbers[5][5] = 7777;

/* both work fine, and you can view access values using both*/
printf("\n%i", pNumbers[7][7]);
printf("\n%i", numbers[9][9]);```
Cheers,
G'n'R

3. short *p = &m1[0][dim/2];
without trying it, i don't see why this shouldn't work. check it and see

-Prelude

4. PRELUDE:

What you have: short *p = &m1[0][dim/2];
does work for me, but the thing is that I need p to be a short **.

And since m1 is a short *** type, when I do
short **p = &m1[0][dim/2];
I get an incorrect value.

Thanks.

5. I'm a bit confused, if using a single dereference works then why do you need to use a pointer to a pointer?

6. Because the statement is in a recursive function which has short** as an argument.

7. Dont know if i am understanding this correctly but if you want a pointer to a pointer i think this is the correct way. However some of it is unclear to me too. Anyway else??

Code:
```short **pp =NULL;
short *p = &m1[0][dim/2];

pp=&p;

/* this is where i am unclear.  Why not the need to dereference the pointer??? But it works */

pp[0][0]= 8;

printf("%i\n", pp[0][0]);

getch();```
Cheers
G'n'R