The basic syntax of the scanf function is almost identical to the printf equivalent:
scanf (<format>, <target variables . . .> )
In this definition, <format> is again a format string containing the same format specifiers, except that only the basic % plus a character actually make any sense in this context. In other words, the scanf function is not really appropriate for use in cases where fields have to be laid out in a specific way on the screen.
If you were to use the scanf function to specify a field width, the input library is not sophisticated enough to stop allowing data entry once the field with has been reached. However, only the data that fits inside the field is used in the variable that the field maps to.
If the data ...