HELP: Pointer to array of 2D. 
Author Message
 HELP: Pointer to array of 2D.

Hi,

 I have a casting problem which I can seem to solve.

We know that:

MYTYPE     *((*ptr)[]);   /* 'ptr' is a pointer to an array of
                             pointers of type 'MYTYPE'.
                          */

ptr = (MYTYPE (*) []) malloc(15 * sizeof(MYTYPE *));

The cast to malloc() is necessary and works.

Now we have:

MYTYPE     *(*((ptr)[]))[]; /* 'ptr' is a pointer to an 2D array
                               of pointers of type 'MYTYPE'.
                            */

ptr = (<I can't work out the cast>) malloc((15*15) * sizeof(MYTYPE *));

What would the casting be???

Please e-mail hints or tips in addition to post.  Many thanks.

Sang.



Mon, 27 Apr 1998 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. 2D array of pointers to 2D arrays

2. Help : Pointer to 2D Array

3. Help needed: 2D arrays and pointers in ANSI C.

4. Which 2D array of 2D array addressing method?

5. char pointer to 2D char array

6. Pointers to 2D arrays

7. converting 2D array to pointer

8. a dynamical 2D array to a double pointer

9. Pointer to 2D array...

10. HOWTO:2d array of pointers to structure

11. pointer arithmetic with 2d arrays?

12. Pointer of a 2d array

 

 
Powered by phpBB® Forum Software