C programming flags and print function
Flag: +
A sign character ("+" or "-") will precede the conversation (overrides a "space" flag)
Printf() function: c
Character
Flag:
If no sign (minus sign e.g.) is going to be written, a blank space is inserted before the value.
Flag: -
The converted value is left adjusted
Printf() function: lf
double
Printf() function: f
float values
printf() function:
function is a critical component when programming in C. It is used to output information from within the program as it executes. A simple example of the printf() function is: > printf("Hello World!") Hello World!
Printf() function: x or X
hexadecimal representation
Printf() function: l or ld or li
long
Printf() function: lu
long double
Printf() function: o
octal representation
Printf() function: p
pointer
Printf() function: %
prints % character
Printf() function: N
prints nothing
Printf() function: e or E
scientific notation or floats
Printf() function: d
signed integer
Printf() function: hi
signed integer (short)
Printf() function: g or G
similar as e or E (scientific notation)
Printf() function: s
string
Flag: 0
the conversion result will be zero padded for numeric values.
Printf() function: U
unsigned int.
Printf() function: i
unsigned integer
Printf() function: hu
unsigned integer (short)
Printf() function: llu
unsigned long long
Flag: #
used with o, x or X specifiers with the value is preceded with Used with o, x or X specifiers the value is preceded with 0, 0o, 0O, 0x or 0X respectively.
