title: Program that takes a users inputted characters and displays them in descending order of occurrence
body: <p><em>"Write a program that reads in a sequence of characters entered by the user and terminated by a period ('.'). Your program should allow the user to enter multiple lines of input by pressing the enter key at the end of each line. The program should print out a frequency table, sorted in decreasing order by number of occurences, listing each letter that ocurred along with the number of times it occured. All non-alphabetic characters must be ignored. Any characters entered after the period ('.') should be left in the input stream unprocessed. No limit may be placed on the length of the input."</em></p>
  
  <p>I don't know where to begin with this. So far this is what I have come up with:</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  
  
  
    int main(){
  
  
          int count=0;
      char ch[count];
      int i=0;
  
      cout&lt;&lt;"Enter a sequence of characters (end with '.'): ";
      cin&gt;&gt;ch[count];
      while(ch[count]!='.')
      {
          count++;
          cin&gt;&gt;ch[count];
  
  
      }
  
      cout&lt;&lt;"There were "&lt;&lt;count&lt;&lt;" characters in the string"&lt;&lt;endl;
      return 0;
   }
  </code></pre>
  
  <p>Right now the program takes in the users input and displays the number of characters in it, but I cannot get it to display any of the characters, let alone in descending order. The sort isn't my problem, that I fully understand how to program, but I cannot display the chars stored in the input stream. </p>
  
  <p>My instructor suggested we use a struct but right now I just need some direction to go. The output should be formatted as the following:</p>
  
  <pre><code>Enter a sequence of characters (end with '.'): do be Do bo. xyz
  
  
  Letter:    Number of Occurrences
  
  o     3
  d     2
  b     2
  e     1
  </code></pre>
  
  <p>I'm not asking for anyone to do the coding for me, I simply need help on where to start, and how to get the chars to display. We cannot use the string class and thus any string functions other than <code>strlen()</code>.</p>