Re: What am I looking for in the documentation?
Re: What am I looking for in the documentation?
- Subject: Re: What am I looking for in the documentation?
- From: Fritz Anderson <email@hidden>
- Date: Fri, 10 May 2013 07:15:28 -0500
It should go without saying that the "text" char array you suggest must already exist, and be at least one char longer than the longest string you expect (I'd make it twice as long).
And use snprintf(3) instead. Bad People (or you) will try to overrun the buffer if you don't prevent it. (Not likely with a %f format spec, but even if you trust the dealer, you always cut the cards.)
— F
On 4 May 2013, at 6:23 PM, Mohit Sharma <email@hidden> wrote:
> You might want to look at sprintf <http://linux.die.net/man/3/sprintf>.
> sprintf(text, "%f", fv) should work just fine.
>
>
> On Sat, May 4, 2013 at 4:20 PM, YT <email@hidden> wrote:
>
>> I have need to turn a local float value into a char array.
>>
>> That is, The Quartz 2D graphics function requires the passing of a (const
>> char *) to a text string or I was thinking of a character array.
--
Fritz Anderson
Xcode 4 Unleashed: 4.5 supplement for free!
http://www.informit.com/store/xcode-4-unleashed-9780672333279
_______________________________________________
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