Re: Converting NSString to char constant (answered)
Re: Converting NSString to char constant (answered)
- Subject: Re: Converting NSString to char constant (answered)
- From: Clark Cox <email@hidden>
- Date: Fri, 2 Jan 2004 22:37:32 -0500
On Jan 02, 2004, at 17:24, KLW wrote:
>
Answered my own question:
>
char cResult = (char)[resultasNSString characterAtIndex:0];
>
>
Anyone have a better, smaller, faster way?
Don't cast the result of -characterAtIndex: to char unless you're
absolutely sure that it is in the ASCII range, otherwise, you'll be
getting back unpredictable values.
--
Clark S. Cox III
email@hidden
http://homepage.mac.com/clarkcox3/
http://homepage.mac.com/clarkcox3/blog/B1196589870/index.html
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.