Following code removed punctuation marks correctly from char array:
#include <cctype>
#include <iostream>
int main()
{
char line[] = "ts='TOK_STORE_ID'; one,one, two;four$three two";
for (char* c = line; *c; c++)
{
if (std::ispunct(*c))
{
*c = ' ';
}
}
std::cout << line << std::endl;
}
How would this code look if the line is of type std::string?
std::stringarray access operator[]to manipulate single characters in the string.