I want to split given string with delimiter "," but its give error
"a value of type \"char *\" cannot be assigned to an entity of type \"std::string *\"
hear is my code
#include<iostream>
#include<string>
int main()
{
std::string str = "1,2,3,4,5,6,7";
std::string* ptr;
ptr=strtok(str,",");
while(ptr!=NULL)
{
std::cout<<ptr<<std::endl;
ptr=strtok(NULL,",");
}
}