This post is about STL String Tokenizer - strtok() function, which separates a given a string about some given delimiters. The strtok() function internally maintains a static variable to store the the state of string.

using namespace std;

int main(){

    char str[] = "Hi, I am teaching about strings, in C++!";
    char *ptr;

    ptr = strtok(str," ,");


        ptr = strtok(NULL," ,!");

return 0;