Name
scan
- scan
string format varName... Parse fields from the string
stringaccording to the ANSI C scanf( ) -style formatformatand place results in the specified variables. Return the number of conversions, or −1 if unable to match any fields. Format placeholders have the form %[*] [width]char, where * discards the field,widthis an integer, and possible values ofcharare as follows:dDecimal
oOctal
xHex
cChar to int
eFloat
fFloat
gFloat
sString (no whitespace)
[
chars]Chars in given range
[
^chars]Chars not in given range
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access