The format specifiers allow the function printf to print the contents of variables, all specifiers consist of a character % followed by one or more alphabetic characters.
| char% c | |
| short, int, long | % d |
| short, int, long | % i |
| unsigned short unsigned int, unsigned long | % u |
| float% f | |
| double | % lf |
| float, double (scientific notation) | % and |
| float, double [use the shorter of% f% e]% g | |
| short , int, long (octal) | % or |
| short, int, long (hexadecimal) | % x |
| pointer% p | |
| sequence characters terminated by a '\\ 0'% s | |
| unsigned long long [64-bit] | % ull |
| long long [64-bit] | % ll |
| long double [64-bit] | % Lf |
| unsigned short [8-bit] | % hu |
0 comments:
Post a Comment