string manipulation help, c ++

Hi, using the code below, what can i add to remove punctuation from user input, and print input back to the screen.

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

string sInput;
int iLength = 0;

void RemoveGrammar()
{
char cCharacter;
int iAscii;
int iPosition;
iPosition = 0;

while (iPosition < iLength) {
cCharacter = sInput.at(iPosition);
iAscii = int(cCharacter);
}
}
int main()
{
if (iLength < 1);
{
cout << "Please enter a sentence" << endl;
getline(cin, sInput);
iLength = sInput.length();
cout << "The length of this sentence is..." << iLength <<" characters"<< endl;
}
void RemoveGrammar();
system("pause");
return 0;
}

The Zero Tolerance Approach to Punctuation:

https://en.wikipedia.org/wiki/Eats,_Shoots_%26_Leaves
Last edited on
Topic archived. No new replies allowed.