[OCLUG-devel] sizeof an array of pointers

Christopher Smith x at xman.org
Mon Jun 20 12:08:02 PDT 2005


Dan Stromberg wrote:
> On Sun, 2005-06-19 at 19:27 -0700, Christopher Smith wrote:
>>You are right that it's returning the size of a pointer to char*.
> 
> Would it not be the size of a single pointer to char **?

Nah. It's effectively doing sizeof(char**), which gives you "the size of
a pointer to char*". The size of a pointer to char** would be doing
sizeof(char***). As you noted, on nearly any system these will be the
same size, but there is a semantic difference.

--Chris


More information about the OCLUG-devel mailing list