View Single Post
  #16   Spotlight this post!  
Unread 01-07-2007, 15:39
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: C Programming Homework Help Needed

The function you are looking for is called "sprintf".

Use it just like you would use printf to print a float. The trick is that it throws it into a string, rather than at the console.

Code:
char * buffer = new char[10];
float f = 12.4;
sprintf(buffer,"%f",f);
I think... I don't have a C compiler in front of me.