> From: Jeffrey Pahren
>
> >> void MyCall(const unsigned char ** x);
> >>
> >> void my_fun()
> >> {
> >>    unsigned char myPointer[50];
> >>        ...
> >>    MyCall(&myPointer);
> >>        ...
> >>    return;
> >>}
>
> Error : illegal implicit conversion from `unsigned char **` to
> `const unsigned char **`
>

You'd get the same error if you tried to implicitly convert 'char *' to
'const char *'.
A const can't be altered but a non-const can.  So, the compiler is helping
you by letting you know about the conversion it has to do to on &myPointer
to make the call to MyCall().  Sure, you're thinking "but I'm not going to
change x inside MyCall".  In that case, pass in a const (e.g., force the
conversion in your code so the compiler knows it's intentional).


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to