H
Heiko Vogel
**** Post for FREE via your newsreader at post.usenet.com ****
Hi newsgroup,
can anybody tell me, why the following code snippet won't compile:
double **ptr;
double const ** const c_ptr = ptr;
I always have to cast it, to let it work correctly:
double **ptr;
double const ** const c_ptr = (double const ** const) ptr;
But it makes me wonder that the following code snippet works without a
cast, though I am doing "nearly" the same as above:
double *ptr;
double const * const ptr = c_ptr;
These lines are perfectly accepted by the compiler -- I don't need to
cast. But why it doesn't work with ** pointers?
Thank you very much,
Heiko Vogel
P.S: I am using the GNU C Compiler (gcc-3.3.2)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
http://www.usenet.com
Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Hi newsgroup,
can anybody tell me, why the following code snippet won't compile:
double **ptr;
double const ** const c_ptr = ptr;
I always have to cast it, to let it work correctly:
double **ptr;
double const ** const c_ptr = (double const ** const) ptr;
But it makes me wonder that the following code snippet works without a
cast, though I am doing "nearly" the same as above:
double *ptr;
double const * const ptr = c_ptr;
These lines are perfectly accepted by the compiler -- I don't need to
cast. But why it doesn't work with ** pointers?
Thank you very much,
Heiko Vogel
P.S: I am using the GNU C Compiler (gcc-3.3.2)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
http://www.usenet.com
Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=