• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Converting Int Binary to Char String
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Converting Int Binary to Char String (From: Jordan Evans <email@hidden>)

  • Prev by Date: Re: Converting Int Binary to Char String
  • Next by Date: Re: Not getting filetype info from FSGetcatlogInfo() function
  • Previous by thread: Re: Converting Int Binary to Char String
  • Next by thread: Any idea for One time authorization....
  • Index(es):
    • Date
    • Thread