Re: Long to C-String
Re: Long to C-String
- Subject: Re: Long to C-String
- From: "John C. Randolph" <email@hidden>
- Date: Mon, 7 Apr 2003 17:04:12 -0700
On Monday, April 7, 2003, at 04:28 PM, Simon Fraser wrote:
David Blanton wrote:
On 4/7/03 4:18 PM, "email@hidden" <email@hidden>
wrote:
you could use the ltoa() function in <stdlib.h> as follows:
ltoa( bytesPtr, buffer, 10 );
There is no man page for ltoa and ltoa is not defined in stdlib.h.
Could it
be elsewhere?
Is there no Cocoa class for what seems to be a common need ...
Convert a
long to a sting or am I misssing something here?
How about [NSString stringWithFormat:@"%d"]?
You can go the other way with [NSScanner scanInt:]
There's an easier way:
long int foo;
NSString *digits = [[NSNumber numberWithLong:foo] stringValue];
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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.