Go to Post In Israel we've got the president supporting FIRST and speaking at events, so it's time for you guys to catch up =] - Tottanka [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 19-01-2003, 14:34
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
The way fcvt works is that it returns a pointer to a static variable inside its function, much like strtok. Therefore, the memory is already allocated and all you have to do is point to it. Thus, you use a char *. Also note that calling fcvt again will overwrite whatever was returned previously. Therefore, you should immediately do a strcpy(localString, stringFromFcvt) so that you don't loose the data.

itoa, on the other hand, probably does the strcpy for you, meaning that the buffer needs to already be allocated and large enough to accept the string.

Other random fcvt notes: Remember that fcvt will not insert a decimal point in the string for you. The location of this decimal point is returned as the third parameter to the function. Same with the sign, which is returned as the fourth.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 17:36.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi