Initializing an array of pointers. 
Author Message
 Initializing an array of pointers.

The construct:

static int *daytab[2]={
{0,31,29,31,30,31,30,31,31,30,31,30,112} };

will not work as, *daytab[2] means an array of two integer pointers.
Obviously, you need to malloc the space before you initialize them.

If it were int daytab[2][13], then it will work.

Also, observe that : int *daytab[2]={2,3};
will work.

Hope this helps.

Disclaimer: Views expressed are my own and do not reflect those of my

IBM AWS Tech Support, Austin         | Phone    :   (512) 838 9741

Thu, 27 Mar 1997 07:59:10 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Initializing an array of pointers through a function

2. problems when initializing pointers to byte arrays

3. problems when initializing pointers to byte arrays

4. initializing array of pointers to int

5. Help: initializing array of void* pointers ...

6. Initialized array of functions pointers in a class??

7. Dereferencing f-pointers, arrays of f-pointers, pointers to f-pointers

8. initialize a pointer to pointer

9. Array of pointers, pointer to array...

10. array pointer/pointer array

11. arrays pointers array of pointers

12. Pointer of Pointers was Pointer of arrays...


Powered by phpBB® Forum Software