Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Leadorn

%s %d %f sprintf

This topic is 5618 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I’m using unsigned long for my world coordinates and when I convert them to ASCII with sprintf(szt,"%d %d",worldx,worldy); sprintf will print them as signed long integers. For the moment I use _ultoa to convert to ASCII, is there a %d for unsigned long? and what is %d %s %f are they some inbuilt operators?

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by Leadorn
and what is %d %s %f are they some inbuilt operators?


double, string, float (in that order)

-eldee
;another space monkey;
[ Forced Evolution Studios ]


::evolve::

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

Share this post


Link to post
Share on other sites
%d is actually a signed decimal integer. See sprintf for a list of format specifiers.

-------
Andrew
PlaneShift - A MMORPG in development.


[edited by - acraig on May 4, 2003 5:06:04 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by acraig
%d is actually a signed decimal integer. See sprintf for a list of format specifiers.

-------
Andrew
PlaneShift - A MMORPG in development.


[edited by - acraig on May 4, 2003 5:06:04 PM]


meh, i guess i knew that.. just easier for me to remember ''d-double''

-eldee
;another space monkey;
[ Forced Evolution Studios ]


::evolve::

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

Share this post


Link to post
Share on other sites
quote:
Original post by eldee

meh, i guess i knew that.. just easier for me to remember ''d-double''



Try ''d-digit''

Share this post


Link to post
Share on other sites
quote:
Original post by Jedyte

Try 'd-digit'




try 'd-decimal'. x-hex, o-octal.


To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

[edited by - jenova on May 5, 2003 8:41:06 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!