Putting words in an array


If I am given a long passage comprising of many paragraphs as input, and I want to add ONLY the words into an array how do I go about skipping the punctuation, enter keys and other special characters or non-alphabets?

Hi, we had a topic yesterday(freshman IT student) about checking punctuations and other sorts of special character in c++. It’s called Character Handling Functions.

But I strongly suggest that you change your algorithm, instead of planning to check if its a punctuation or any special character, you should just check if it is a letter or not.

For checking letters, you can use


It returns 1 if c is a letter and 0 otherwise, with a syntax of

isalpha©; //assuming that c is the variable that you will check

remember to include the cctype library in order for the function to work.