Format |
Output |
Input |
%c |
character |
character |
%nc |
character, right adjusted to a space of n characters, filled with spaces |
n characters |
%-nc |
character, left adjusted to a space of n characters, filled with spaces |
not allowed |
%d, %i |
integer |
integer |
%ld,%li |
not allowed |
long integer |
%hd,%hi |
not allowed |
short integer |
%nd,%ni |
integer, right adjusted to a space of n characters |
not allowed |
%-nd,%-ni |
integer, left adjusted to a space of n characters |
not allowed |
%0nd,%0ni |
as %nd,%ni, but spaces are pedded with 0 |
not allowed |
%u |
unsigned integer (%lu,%hu,%nu,%-nu,%0nu as for integer) |
unsigned integer |
%o |
unsigned octal integer (%lo,%ho,%no,%-no as for integer) |
unsigned octal |
%x |
unsigned hex integer (%lx,%hx,%nx,%-nx as for integer) |
unsigned hex |
%X |
as %x |
as %x |
%e |
floating point (scientific format) |
floating point |
%n.me |
floating point (scientific format) of length n and m digits |
not allowed |
%-n.me |
as %n.me but left adjusted |
not allowed |
%E |
as %e but capital E in output (same for %n.mE and %-n.mE) |
floating point |
%f |
as %f but in fixed format (same for %n.mf and %-n.mf) |
floating point |
%g |
%f or %e, what ever is shorter (same for %n.mg and %-n.mg) |
floating point |
%G |
%f or %E, what ever is shorter (same for %n.mG and %-n.mG) |
floating point |
%le,%lE,%lf,%lg,%lG |
not allowed |
double |
%Le,%LE,%Lf,%Lg,%LG |
not allowed |
long double |
%s |
string |
string |
%ns |
string with total space of n characters |
string from first n characters. |
%n.ms |
string with total space of n characters and length of m characters |
not allowed |
%p |
hex value of pointer |
not allowed |
%% |
%-symbol |
match %-symbol |
%[characters] |
not allowed |
string of reduced characters set |
%[^characters] |
not allowed |
string with excluding character set. |