-, , strtok . C89, , , (, 4.3BSD, 1986 ). sscanf, , , strtok.
, strtok, , , ( sscanf), .
This manual parsing can be quite simple, just iterate over the line until you find a digit, and then collect all consecutive digits when building the number. As soon as you receive a character without numbers, you have your number. Of course, this will only get the first number in the string.
source
share