Friday, November 15, 2013

The % Format Specifiers in C

The % specifiers that you can use in ANSI C are:

Usual variable type Display
%c: char single character
%d (%i): int signed integer
%ld: long signed integer
%hd short signed integer
%e (%E): float or double exponential format
%f: float signed decimal
%lf: double signed decimal
%g: (%G) float or double use %f or %e as required
%o: int unsigned octal value
%p: pointer address stored in pointer
%s: array of char sequence of characters(string)
%u: int unsigned 
%lu: long unsigned
%x: (%X) int unsigned hex value

No comments:

Post a Comment