URGENT c++ bug; string manipulation

Hi all, the code below is intended to remove all punctuation from the user input, and then print the strings back to the user. However, in my code, when putting any punctuation, it prints onto the screen, and is not removed. Any ideas why?

include <iostream>
#include <string>
#include <cctype>
using namespace std;

int main()
{
string sInput;

cout << "Enter a string/s...";
getline(cin, sInput);
cout << sInput << endl;

string sPunct = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 ";
int iPos1;

iPos1 = sInput.find_first_not_of(sPunct);
return 0;
}
The code you posted just outputs back the input verbatim. After that, the rest of the code doesn't modify any strings. std::string::find_first_not_of() just returns a number without altering the string.
seems punctuation is the topic du jour - check this out http://www.cplusplus.com/forum/beginner/207036/
Topic archived. No new replies allowed.