Re: Obtaining a value from a hex representation
Re: Obtaining a value from a hex representation
- Subject: Re: Obtaining a value from a hex representation
- From: Carl Hoefs <email@hidden>
- Date: Fri, 08 Jan 2016 15:36:28 -0700
On Jan 8, 2016, at 3:16 PM, Steve Mills <email@hidden> wrote:
>
> Either use NSScanner or strtol if you have char* (or strtoll if it's longer than 8 hex chars).
> Sent from iCloud's ridiculous UI, so, sorry about the formatting
>
Hadn't thought to use NSScanner, though it appears a bit overkill.
strtoll() works fine. (Note: Hex values greater than 7FFFFFFF require the use of strtoll(). strtol() returns -1 in such cases.)
Guess I'll create a NSString category so I can have a -hexValue method after all.
Thanks Steve, Quincey, Jens!
-Carl
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden