Hi, all
I am trying to write the function to get rid of my punctuations.
My code:
//_word_list is the vector<string> type
void TextUtil::isnotpuct() const
{ for(size_t i=0; i<_word_list.size(); i++)
{
size_t len = _word_list[i].length() + 1;
for(size_t j=0; j< len;j++)
{ if(ispunct(_word_list[i][j]))
{
_word_list[i] = "";
}
j++;
}
i++;
}
}
But i got the error:
error C2440: '=' : cannot convert from 'const char [1]' to 'const char'
Where is the problem with my code??
Many thanks.