I am trying to remove a string from the vector if the string is equal to the original word provided so the output does not count the inputed word as an anagram of it self (if that makes sense)
for (std::vector<std::string>::const_iterator word = anagrams.begin();
word != anagrams.end(); ++word) {
if (*word != originalstring) {
++totalNumber;
// std::cout << *i;
} else {
anagrams.erase(word);
}
}
really unsure why I am getting this error as it should be erasing the original word but I get the segmentation error :/