But then you are bound to get in trouble if you try to change the label
which is now pointed by plain char * and not const.
--
--
Regards,
Miron.
======================================================================
Eng. Miron Ophir,
The MobiMate Team
E-Mail: [EMAIL PROTECTED]
Home Page: www.mobimate.com
Private E-Mail: [EMAIL PROTECTED]
[EMAIL PROTECTED]
Private Home Page: http://members.tripod.com/ophirm
ICQ: 6785948
======================================================================
"Richard Burmeister" <[EMAIL PROTECTED]> wrote in message
news:51419@palm-dev-forum...
>
> > From: S Santoso
> >
> > CharPtr fldChar;
> > fldChar = CtlGetLabel(GetObjectPtr(objectID));
> >
> > The error is : illegal implicit conversion from 'const char *' to 'char
*'
> > However,
> > fldChar = (CharPtr) CtlGetLabel(GetObjectPtr(objectID));
> > Then, the error is out.
> >
> > My question is : Why by adding type of variable (CharPtr) is
eliminating
> > the error?
> >
>
> In the docs for SDK 3.5, you'll see that CtlGetLabel returns const Char *,
> not Char *, or CharPtr. So, the compiler is doing you a favor by refusing
> to implicitly convert one type to another. When you put (CharPtr) in
front,
> you are explicitly converting the const Char * to a CharPtr, so the
compiler
> does what you tell it to do without complaining.
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/