C - Determining which delimiter used - strtok()
问题 Let's say I'm using strtok() like this.. char *token = strtok(input, ";-/"); Is there a way to figure out which token actually gets used? For instance, if the inputs was something like: Hello there; How are you? / I'm good - End Can I figure out which delimiter was used for each token? I need to be able to output a specific message, depending on the delimiter that followed the token. 回答1: Important: strtok is not re-entrant, you should use strtok_r instead of it. You can do it by saving a