I pointed out the 32bits system that was just for "sizeof(p)", not for
"sizeof(char)".

2009/4/10 Paul Herring <[email protected]>

>
>
> On Thu, Apr 9, 2009 at 6:21 PM, Nicle <[email protected]<ynicle%40gmail.com>>
> wrote:
> > void foo(char *p) {
> >    int array_len = 0;
> >    array_len  = sizeof(p)/sizeof(char);
> > }
>
> Minor point - sizeof(char) can *never* be anything other than 1 in C
> (or C++.) No matter how many bits are in it. sizeof(char) should not
> appear in your code.
>
> sizeof(char*) is another matter however.
>
> --
> PJH
>
> http://shabbleland.myminicity.com
> http://www.chavgangs.com/register.php?referer=9375
>  
>


[Non-text portions of this message have been removed]

Reply via email to