i have
const char* hour = "Wed Mar 23 18:10:57 2016";
I would like to cut "18:10:57" in another new const char*
i have
const char* hour = "Wed Mar 23 18:10:57 2016";
I would like to cut "18:10:57" in another new const char*
I think what you are looking for is the std::strtok()
function. There is a reference here.
You will need to copy your original data into a temporary area that does not have the const
attribute. std::strtok()
will split your string up according to the delimiter you specify, in this case a single blank character.
Each successive call to std::strtok()
will advance a pointer to the next token in the string.