Re: Seeding random() randomly
Re: Seeding random() randomly
- Subject: Re: Seeding random() randomly
- From: Graham Cox <email@hidden>
- Date: Fri, 27 May 2011 12:06:48 +1000
On 27/05/2011, at 11:53 AM, Ken Thomases wrote:
> %u
>
>> I'm confused about how to correctly write format specifiers for both 32 and 64-bit runtimes. The 64-bit porting guide doesn't spell it out (yet you end up with code peppered with warnings that you should examine the use of the format specifier without docs properly explaining their correct use). It's also not clear to me whether just 'unsigned' is a fixed-size quantity or not, depending on architecture.
>
> Just "unsigned" is shorthand for "unsigned int". Between the Mac's 32-bit and 64-bit architectures, int doesn't change size. That can't be generalized, although it's darn-near universal.
>
> However, that's irrelevant. The format specifiers don't indicate a size. They indicate a type. For "unsigned", you use "%u". That's the end of the story.
Thanks Ken, very helpful.
I just looked again at the 'string format specifiers' page in the docs. Seems it's been much fleshed out since I last looked, and sure enough it's now much clearer what to use when.
--Graham
_______________________________________________
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