alpha and numeric characters

closed account (16MoizwU)
I have an assignment that asks the user to input a sequence of 10 characters that must be alphabetic and numeric combined. Store the sentence in a cstring variable and count the amount of alphabetic character the input has and the amount of numeric characters the input contains. the output should list the alphabetic characters in one line saying " the list of alphabetic characters are: " and the actual list. In a new line output " the total number of alphabetic character is: " followed bye the actual number. Finally in other two lines repeat the same but this time for the numeric characters.


I am really not understanding how to write the whole program, it's making me more confuse everytime, please help me to solve it out.
If you are using a string, you can use stringstreams to look at each char invidually. For C strings, you can just iterate through it. Then just you isalpha() to see what type of character you have, and then you can decide wether to pass it on the another string/stringstream, or toss it.
Topic archived. No new replies allowed.