I would like the output of this string to display each word in a column and ignore all punctuation. I have tried including an if statement that tells the string to start on a new line when a space is encountered but I haven't had any luck. Any hints are most welcome.
#include <iostream>
using namespace std;
int main()
{
const int SIZE = 257;
char line[SIZE];
char element;
int length = 16;
cout << "Enter a string (up to 256 characters): ";
cin.getline(line, SIZE);
char* str1 = line;
cout << "The sentence you entered is:\n";
for (int j=0; j<strlen(str1); j++)
cout << str1[j] << endl;
cout << endl << "\n";
system("PAUSE");
return 0;
}