The difference between %d %f %c %s, etc. in c language

%D integer output (%ld long integer output)
%f is output in decimal form, and 6 decimal places are reserved by default

Here is the reference
%f and %lf are the corresponding format symbols when the float type and the double type are used to format input and output.
Among them:
float, single-precision floating-point type, corresponding to %f
double, double-precision floating-point type, corresponding to %lf

%C is used to output a character
%s is used to output a string
%o is used to output an integer in the form of an octal number
%x is used to output an integer in the form of a hexadecimal number, or the address of the string is
output %p output address

Guess you like

Origin blog.csdn.net/solo_bro/article/details/105842531