i2s

Non-platform specific questions.

i2s

Postby Joshua Worth » Thu Mar 02, 2006 9:19 pm

is there a way to convert an integer to a string?
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score

Postby makslane » Fri Mar 03, 2006 12:26 am

You can use the sprintf function:

sprintf(text, "%d", integerNumber);

or

sprintf(text, "%f", realNumber);
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

convert real number to string and assign to variable

Postby geuser7 » Thu May 25, 2006 4:55 am

sprintf(text, "%f", realNumber); I guess can be used I guess to display but how can I convert a real number to a string and assign it to a string variable?
geuser7
 
Posts: 6
Joined: Tue May 09, 2006 8:20 pm
Score: 0 Give a positive score

Postby DilloDude » Thu May 25, 2006 5:30 am

Just use sprintf(stringvariable, "%f", realNumber);
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

that worked thanks!... other questions:

Postby geuser7 » Thu May 25, 2006 6:16 am

Thanks for your very quick answer... I do have some more questions maybe you or others could help with:
- How can I clear variables - real, int or string (not set to 0 or "" but clear)?
- How can I play a sound after another sound has finished... I want the fact that a sound has finished playing to trigger a new sound to play?
- Are there icon editors that you can suggest (free to start?) ... I have been testing one called IconCool but not getting great results... the incons look blurry... need to find the correct size to create them for both windows and pocket pc..
- I am having a bit of troulbe with load/creating animation graphics... when I load my images file they seem to overlap each while scrolling though they seem to have enough blank space between images..
- Is there a chat room (maybe on icq, yahoo, msn, etc.) that many of you chat at that I can join?
geuser7
 
Posts: 6
Joined: Tue May 09, 2006 8:20 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest