The companion to scanf, sscanf is used to read data from a string (perhaps acquired from a file) into the variables, rather than from the keyboard. As with sprintf, the first parameter is a variable, but it provides the source of the formatted string, rather than the target.
sscanf (<source string>, <format>, <target variables. . .> )
So the sscanf function will break up the source string according to the format specifiers included in the format string and place the results in the target variables. The same conversion rules apply with sscanf; in other words, although it can be used in conjunction with field width specifiers, they will not discard data in the way you might expect.
A simple usage of the sscanf function might be as ...