Need to prompt user for text, count occurrence of each alphabetic character, then sort and print in descending order. I'm using two parallel arrays, one for characters, one for occurrence of each, I know how to sort with a for loop. Don't know how to extract from string.
Use something like
while (cin >> s)
?
Any suggestions?
Program needs to read text until terminated by pressing <enter><ctrl+d>. This is all in a Unix environment, code is C++, if it matters.