Strtok() not working with string

strtok() is not working when i am using string rather than character array.
link to my code: https://ide.codingblocks.com/s/208073

strtok do not work for strings. They only work for character array. So for using strtok you have to convert the string to a character array.
To convert string to character array, refer this:
https://www.techiedelight.com/convert-string-char-array-cpp/

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.