scanf () function's control string function name: scanf function: Perform formatted input usage:intscanfChar*format[,argument,...]); The scanf () function is a universal terminal format input function that reads input information from a standard input device (keyboard). You can read any intrinsic type of data and automatically transform the values into the appropriate in-machine format. Its invocation format is: scanf ("< formatting strings >",< Address Table >The scanf () function returns the number of data items that were successfully assigned, and EOF when an error occurs. The control string is composed of three types of characters:1. format specifier;2. whitespace character;3. Non-whitespace character; (A) formatting instructions format character Description%a read in a floating-point value (only C99 valid)%A Ibid .%c read in a character%d read in decimal integer%I read in decimal, octal, hexadecimal integer%o read in octal integer%x read in hexadecimal integer%X Ibid .%c read in a character%s reads in a string%F read in a floating-point number%F Ibid .%e Ibid .%E Ibid .%g Ibid .%G Ibid .%p read in a pointer%u read into an unsigned decimal integer%n the equivalent number of characters that have been read into the value%[] Scan character Set% Read%symbol append format specifier character descriptor specifier description L/L length modifier input"Long"Data H-length modifier input"Short"Data W Integer constant Specifies the width of the input data*asterisks read one data hh,ll ibid. h,l but only valid for C99. (B) white space character whitespace character causes the scanf () function to omit one or more whitespace characters from the input in the read operation, the white space can be space,tab,newline, and so on, until the first non-whitespace character appears. (C) non-whitespace characters a non-whitespace character causes the scanf () function to reject characters that are the same as this non-whitespace character when read.
Reference:
The use of scanf function in C language
The use of scanf function in C language