Tell me more ×  I know this problem crops up a lot, but I
couldn't find a piece of code which worked for me.  I am trying
to strip all punctuation off of an incoming string using
find_first_not_of and find_last_not_of methods in the string
library:  //strip punctuation characters from string void
stripPunctuation(string &temp)     string alpha =
"abcdefghijklmnopqrstuvwxyz";      size_t bFound =
temp.find_first_not_of(alpha);      size_t eFound =
temp.find_last_not_of(alpha);      if(bFound != string::npos)
if(eFound != string::npos)  Basically, I want to delete anything
at the front of the string that is not alphabetic and anything
at the end of the string which is not alphabetic. When this
function gets called, it results in a segmentation fault. I am
not sure where I should be passing bFound and eFound?
share|improve this question What is your question? What is your
problematic input? Have you noticed that you never pass bFound
or eFound to .erase, so your code makes a wild assumption? – 
Lightness Ra