Here's just a small snippet of code that correctly removes punctuation marks from "hello." Please explain what line 14 is doing. I have no idea! Also what is ispunct and where is it defined? The reference documentation for string::erase and replace_if are not helping at all.
template < class ForwardIterator, class Predicate >
ForwardIterator remove_if ( ForwardIterator first, ForwardIterator last, Predicate pred );
pred
Unary predicate taking an element in the range as argument, and returning a value indicating the falsehood (with false, or a zero value) or truth (true, or non-zero) of some condition applied to it. This can either be a pointer to a function or an object whose class overloads operator().
Also, how would I test whether a _word contains ONLY punctuation marks