Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ EXP problem in score

EXP problem in score

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2 

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #15 on Sun 22 Feb 2004 11:57 PM (UTC)
Message
Here are the types from the man page:


TYPE specifies what kind of conversion `printf' performs.  Here is
a table of these:

`%'
     prints the percent character (`%')

`c'
     prints ARG as single character

`s'
     prints characters until precision is reached or a null
     terminator is encountered; takes a string pointer

`d'
     prints a signed decimal integer; takes an `int' (same as `i')

`i'
     prints a signed decimal integer; takes an `int' (same as `d')

`o'
     prints a signed octal integer; takes an `int'

`u'
     prints an unsigned decimal integer; takes an `int'

`x'
     prints an unsigned hexadecimal integer (using `abcdef' as
     digits beyond `9'); takes an `int'

`X'
     prints an unsigned hexadecimal integer (using `ABCDEF' as
     digits beyond `9'); takes an `int'

`f'
     prints a signed value of the form `[-]9999.9999'; takes a
     floating point number

`e'
     prints a signed     value of the form
     `[-]9.9999e[+|-]999'; takes a floating point number

`E'
     prints the same way as `e', but using `E' to introduce the
     exponent; takes a floating point number

`g'
     prints a signed value in either `f' or `e' form, based on
     given value and precision--trailing zeros and the decimal
     point are printed only if necessary; takes a floating point
     number

`G'
     prints the same way as `g', but using `E' for the exponent if
     an exponent is needed; takes a floating point number



- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #16 on Mon 23 Feb 2004 02:11 AM (UTC)
Message
THanks Nick, i'll put that into a notepad file for later use.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


55,334 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.