elfert.de · printf-Formatierung ·

· Seitenmenü ; · Eigene Services : · Nützliches unter Linux (Debian) : · Mikrocontroller/Programmierung : · Elektronik : · Diverses : · Lustiges : · Sonstiges :


{printf-Formatierung}
printf("%i %i", variable1, variable2);
Specifier Output Beispiel
%c Character a
%d or %i Signed decimal integer 392
%e Scientific notation (mantise/exponent) using e character 3.9265e+2
%E Scientific notation (mantise/exponent) using E character 3.9265E+2
%f Decimal floating point 392.65
%g Use the shorter of %e or %f 392.65
%G Use the shorter of %E or %f 392.65
%o Signed octal 610
%s String of characters sample
%u Unsigned decimal integer 7935
%x Unsigned hexadecimal integer 7ca
%X Unsigned hexadecimal integer (capital letters) 7CA
%p Pointer address B800:0000
%n Nothing printed. The argument must be a pointer to a signed int, where the number of characters written so far is stored.  
%% A % followed by another % character will write % to stdout.  


 
· · · · © elfert.de · · Tobias Elfert · · · ·