C++ Primer 3.2.3

Write a program that reads a string of characters including punctuation and writes what was read but with the punctuation removed


I have tried it but there is an error :-

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

int main()
{
string s;
cin >> "Enter a sentence :" >> s >> endl;
for (auto c : s)
if (ispunct(c))
remove punct;
cout << s << endl;

}
Topic archived. No new replies allowed.