Subject: Re: iconv(3) prototype
To: None <tech-userlevel@NetBSD.org>
From: Alan Barrett <email@example.com>
Date: 07/28/2004 16:48:48
On Wed, 28 Jul 2004, Andrew Brown wrote:
> if i understand this properly (seebs?), it's like this:
> "const char **" is a pointer to a constant pointer to a character.
> "char * const*" is a pointer to a pointer to a constant character.
> the former is in the prototype. the latter is the type end up with
> when you take the address of x, where x is a "const char *".
You have that almost exactly backwards. Perhaps you should use cdecl?
cdecl> explain const char ** x;
declare x as pointer to pointer to const char
cdecl> explain char * const * x;
declare x as pointer to const pointer to char
cdecl> explain char ** const x;
declare x as const pointer to pointer to char
--apb (Alan Barrett)