look at "d" . Sometime I see d and sometime I see "f" I want to know how difference d and f ? And expect d,f have other a,b,c,...,z ?
Should return "Today is August 24, 2000."
The number before the d is the minimum field width, eg. '2' would be printed ' 2' in the $day field. Since there is a 0 in front of the two, then the justification is filled with zeros, eg '2' would be printed '02'.
hello ryojung,
here is some tips which wil be helpful for u
the various sprintf formats are :
%c - character
%s - String
%d - Signed int in decimal notation
%u - Unsigned int in decimal notation
%o - Unsigned int in octal notation (*****it is not %zero )
%x - Unsigned int in hexadecimal notation.
%e - Floating point no in scientific notation.
%f - Floating point no, in fixed decimal notation.
%g - Floating point no in %e or %f formats
%X - Same as %x but using capital letters for hex
representation.
%p - Pointer prints the memory address of a variable in
hexadecimal
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.