Top "Strtok" questions

strtok() is a Standard C (ISO 9899:1989) function for splitting a string in tokens.

Do I need to free the strtok resulting string?

Or rather, how does strtok produce the string to which it's return value points? Does it allocate memory dynamically? I …

c free strtok
Segmentation Fault when using strtok_r

Can anyone explain why I am getting segmentation fault in the following example? #include <stdio.h> #include <…

c segmentation-fault strtok
How to use strtok in C properly so there is no memory leak?

I am somewhat confused by what happens when you call strtok on a char pointer in C. I know that …

c malloc free strtok
Need to know when no data appears between two token separators using strtok()

I am trying to tokenize a string but I need to know exactly when no data is seen between two …

c strtok
How to remove first word from a string?

Let's say I have string sentence{"Hello how are you."} And I want string sentence to have "how are you" …

c++ string stringstream strtok
get the last token of a string in C

what I want to do is given an input string, which I will not know it's size or the number …

c tokenize strtok
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 …

c tokenize strtok
Why is strtok changing its input like this?

Ok, so I understand that strtok modifies its input argument, but in this case, it's collapsing down the input string …

c strtok
strtok function thread safety

I have been spending some time in debugging a programme which gives segmentation fault. The bug is quite indeterministic and …

c linux thread-safety strtok
How to use Strtok for tokenizing a Const char*?

I have a const char* variable which may have a value like "OpenStack:OpenStack1". I want to tokenize this const …

c++ c strtok