Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFStringRef to hexa



On Jun 30, 2006, at 04:52, Steve Baxter wrote:

Casting to a longint isn't going to do what you want!

I would convert to a UTF8 C string and use sscanf with "%lx" to get the number out. I'm guessing this should be safe as the numbers and letters *should* be single byte characters.

I guess what we really want is CFsscanf and CFsprintf...

CFStringCreateWithFormat and CFStringCreateWithFormatAndArguments already exist for going one direction, but I can't find anything in CFNumber of CFNumberFormatter to go the other way. Seems like there should be. I'd submit a feature request if I were you. But in the mean time, use sscanf.


_________________________________________________________
Steve Mills                              Me: 952-401-6255
Senior Software Architect                         MultiAd
email@hidden                       www.multi-ad.com


_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >CFStringRef to hexa (From: Alex Ivanov <email@hidden>)
 >Re: CFStringRef to hexa (From: "Matthias Schmidt" <email@hidden>)
 >Re: CFStringRef to hexa (From: Steve Baxter <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.