title: Function calculating the probability of a letter in an sentence
body: <p>I have a function that is supposed to calculate the number of times a letter occurs in a sentence, and based on that, calculate the probability of it occurring in the sentence. To accomplish this, I have a sentence:</p>
  
  <blockquote>
    <p>The Washington Metropolitan Area is the most educated and affluent metropolitan area in the United States.</p>
  </blockquote>
  
  <p>An array of structures, containing the letter, the number of times it occurs, and the probability of it occurring, with one structure for each letter character and an additional structure for punctuation and spaces:</p>
  
  <pre><code>struct letters
  {
    char letter;
    int occur;
    double prob;
  }box[53];
  </code></pre>
  
  <p>This is the function itself:</p>
  
  <pre><code>void probability(letters box[53], int sum
  {
       cout&lt;&lt;sum&lt;&lt;endl&lt;&lt;endl;
       for(int c8=0;c8&lt;26;c8++)
       {      
         box[c8].prob = (box[c8].occur/sum);
         cout&lt;&lt;box[c8].letter&lt;&lt;endl;
         cout&lt;&lt;box[c8].occur&lt;&lt;endl;
         cout&lt;&lt;box[c8].prob&lt;&lt;endl&lt;&lt;endl;
       }
  }
  </code></pre>
  
  <p>It correctly identifies that there are 90 letters in the sentence in the first line, prints out the uppercase letter as per the structure in the second line of the for loop, and prints out the number of times it occurs. It continually prints 0 for the probability. What am I doing wrong?</p>