In solving a string challenge (strtoke)

in solving a string challenge (strtok implementation video)

why is it necessary to do
charptr= strtok((char)str.c_str( ), " ")
because previously in videos we were directly giving any string to stroke
e.g.
string s= " today is a rainy day ";
char*ptr = strtok(s, " ");

this is wrong you can’t pass string in strtok() function it should be char array

that is why we have write (*char )str.c_str( ); to convert string into character array

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.