I want to convert string from input file to a char array to tokenize the file. This code might have other problems but for now, the compiler says "incompatible types in assignment of ‘const char*’ to ‘char [100]’".
string filename = "foo.txt";
ifstream data(filename.c_str());
string temp;
char str[100];
char* pch;
while (getline(data, temp)){
str = temp.c_str();
pch = strtok(str, " ,.");
while (pch != NULL){
cout << pch << endl; //Or something else, Haven't gotten around to this part yet.
pch = strtok (NULL, " ,.");
}
}