#include< iostream >
#include< sstream >
#include< string.h >
using namespace std;
int main()
{
string s = "hello this is vit university i love chocolates";
istringstream iss(s);
string temp;
char* coll;
int i = 0;
while (iss >> temp)
{
cout << temp << endl;//(char *)temp.c_str();
strcpy(coll, "something here");
//i++;
//cout<<(char *)temp.c_str()<<endl;
}
return 0;
}
Error in code, strcpy(coll,"sldjs"); is exiting the code, what is the issue here?