D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

Character arrays was Re: [LUG] C - global arrays



My C isn't getting any better..... someone sent me a patch....

.h has
static const char * const bookbin[] = {  
 "string",                                       
.....strings .....
 NULL };


.c has
const char **booktry;

   bookloaded = 1;
   for (booktry = bookbin; *booktry ; booktry++) { 
...rest of loop....

Eek my brain exploded.... too many "*"'s

Which bit of that for statement causes the GCC warning (and
why!);

warning: assignment discards qualifiers from pointer target type

I understand what the code is doing, and it works, but I don't
understand the detailed placing of the "const"'s and "*"'s.

Can someone translate warning into one syllable words.

--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.


Lynx friendly