mattshen
8/24/2019 - 12:21 PM

C codes, sequences, format specifiers

Special CharacterEscape Sequence
alert (beep)\a
backslash\
backspace\b
carriage return\r
double quote\"
formfeed\f
horizontal tab\t
newline\n
null character\0
single quote\'
vertical tab\v
question mark?

#C #Format #Specifier

FORMAT SPECIFIERSDESCRIPTION
%d or %iSigned Integer. Supports short, unsigned short, int and long.
%hiSigned Integer. Supports short.
%huUnsigned Integer. Supports Unsigned short.
%l or %ld or %liSigned Integer. Supports long.
%luUnsigned Integer. Supports unsigned int and unsigned long.
%lli or %lldSigned Integer. Supports long long.
%lluUnsigned Integer. Supports unsigned long long.
%oOctal of an Integer. Supports short, unsigned short, int, unsigned int and long.
%uUnsigned integer. Supports unsigned int and unsigned long.
%x or %XHexadecimal of Unsigned Integer. Supports short, unsigned short, int, unsigned int and long.
%e or %E or %g or %GScientific notation of float values. Supports float and double.
%fFloating point(float).
%lfFloating point(double).
%LfFloating point(long double).
%cCharacter. Supports char and unsigned char.
%sString(char *).
%pPointer address to void(void *).
%nNull value(prints nothing).
%%Prints % character.