<1>
The format description consists of "%" and format characters, such as%d%f. Its function is to convert the output data to the specified format output. The format description always starts with a "%" character. Different types of data are used in different format characters.
Format characters are d,o,x,u,c,s,f,e,g and so on.
Such as
%d integer output,%ld long integer output,
%o output integers as octal numbers,
%x outputs integers as hexadecimal digits,
%u outputs unsigned type data (unsigned number) in decimal numbers.
%c is used to output one character,
%s is used to output a string,
The%f is used to output real numbers in decimal form,
%e output real numbers in exponential form,
%g automatically select either f format or e format according to size, and does not output meaningless 0.
scanf (control character, address list)
The meaning of the format character is the same as the printf function, where the address list is a table column consisting of several addresses, either the address of the variable or the first address of the string. such as scanf ("%d%c%s", &a,&b,str);
<2>
2017.2.17 C Language Review notes