A command-line length can be converted directly: `size_t len = strtoul(argv[1], 0, 0);`. The two zero arguments select the common defaults. section 16.4
The declaration `unsigned long strtoul(char const nptr[restrict], char** restrict endptr, int base);` converts the initial numeric portion of a string to `unsigned long`. `endptr` can receive the position where conversion stops; passing `0` ignores that feature. section 8.4
TAKEAWAY: choose the base deliberately, especially when input may use several numeric notations.
- Pass `10`, `8`, or `16` for decimal, octal, or hexadecimal interpretation. section 8.4
- Pass `0` to select the usual notation: `7` is decimal, `007` octal, and `0x7` hexadecimal. section 8.4 section 16.4
- Interpretation proceeds through whitespace, an optional sign, the number, and remaining data; overflow handling sets `errno` to `ERANGE` in the implementation shown. section 8.4
Explicit and defaulted calls
`strtoul(argv[1], 0, 0)` accepts the input format selected by its prefix. When the stopping position matters, use all parameters explicitly, as in `strtoul(argv[1], ptr, 10)`. section 16.4
unsigned long int strtoul(char const nptr[restrict],
char** restrict endptr,
int base);
!@%STYLE%@!
{"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":0,\"ch\":0},{\"line\":0,\"ch\":17}],[{\"line\":0,\"ch\":18},{\"line\":0,\"ch\":25}],[{\"line\":0,\"ch\":26},{\"line\":0,\"ch\":36}],[{\"line\":0,\"ch\":42},{\"line\":0,\"ch\":50}],[{\"line\":1,\"ch\":33},{\"line\":1,\"ch\":41}],[{\"line\":0,\"ch\":26},{\"line\":0,\"ch\":30}],[{\"line\":1,\"ch\":26},{\"line\":1,\"ch\":30}],[{\"line\":0,\"ch\":42},{\"line\":0,\"ch\":50}],[{\"line\":1,\"ch\":33},{\"line\":1,\"ch\":41}],[{\"line\":0,\"ch\":14},{\"line\":0,\"ch\":17}],[{\"line\":2,\"ch\":26},{\"line\":2,\"ch\":29}]]"}
!@%STYLE%@!
Use the declaration to inspect the string, end-pointer, and base parameters together. section 8.4

