#include <iostream>
#include <cstring>

int main()
{
    std::string s = "first second third fourth fifth sixth";
    for (char* tmp = std::strtok(&s[0], " "); tmp;
         tmp = std::strtok(nullptr, " "))
    {
        std::string s(tmp);  // can "<< tmp <<" below directly....
        std::cout << "S " << s << '\n';
    }
}