Does Strtok_R Change the String?
Because Strtok() Modifies the Initial String to Be Parsed, the String Is Subsequently Unsafe and Cannot Be Used in Its Original Form. If You Need to Preserve...
Because strtok() modifies the initial string to be parsed, the string is subsequently unsafe and cannot be used in its original form. If you need to preserve the original string, copy it into a buffer and pass the address of the buffer to strtok() instead of the original string.
Why does strtok change the string?
It's because strtok inserts nulls into each separator, which is why you use repeated calls to strtok to get each token. The input string cannot be used once you start using strtok.
Is strtok_r destructive?
So strtok is destructive? Yes.