On Thu, Apr 9, 2009 at 6:21 PM, Nicle <[email protected]> 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

Reply via email to