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;
}
Last edited on