strtoull converts the initial numeric portion of a string to an unsigned long long value. Its third argument selects the base, while its second argument receives a pointer to the first character not consumed. section 14.1
Parsing repeated numbers
A loop can advance through a string by passing the address of next and then assigning act = next:\n\nfor (char* next = nullptr; act[0]; act = next) {\n numb[n] = strtoull(act, &next, base);\n if (act == next) break;\n ++n;\n}\n\nIf no number is found, next equals act, so the loop stops. Otherwise, next identifies the parsing boundary. section 14.1
The base controls which characters belong to the number:
- Base 10 parses 0789a as 789 and stops at a. section 14.1
- Base 8 parses 0789a as 7 and stops at 8. section 14.1
- Base 16 parses the hexadecimal digits before the terminating character. section 14.1
- Base 0 infers the effective base from the first character or first two characters; a leading 0 therefore makes 0789a octal. section 14.1
Use strtoull to parse input, not to discover the boundaries of numbers originating from C literals. Literal spelling can diverge from string-processing syntax: C23 digit separators may cause parsing to stop much earlier than intended. section 8.5.1

