Re: Converting Int Binary to Char String
Re: Converting Int Binary to Char String
- Subject: Re: Converting Int Binary to Char String
- From: Sherm Pendley <email@hidden>
- Date: Fri, 6 Jan 2006 06:08:17 -0500
On Jan 6, 2006, at 4:16 AM, Jordan Evans wrote:
Do anyone here know of the fastest algorithm in
Objective-C code for changing a 32 bit integer into a
character string?
Perhaps I'm missing some critical part of your requirements, but have
you tried the simplest solution?
NSString *foo = [NSString stringWithFormat:@"%u", anUnsignedInt];
Or, if you need to avoid messaging entirely, and a char* string is
sufficient:
char *foo;
retCode = asprintf(&foo, "%u", anUnsignedInt);
if (NULL != foo) {
// Do stuff with foo
free(foo);
}
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden