title: Conditional jump or move depends on uninitialised value(s) in C valgrind
body: <pre><code>sentences = malloc(sizeof(int) * totalSentences);
  
  for (int i = 0; i &lt; totalSentences; i++) {
    sentences[i] = 0;
  }
  
  //Count characters in each sentence
  int currentSentence = 0;
  for (int i = 0; i &lt; length; i++) {
    if (ispunct(*input_str)) {
      currentSentence++;
    }
    if (isalpha(*input_str)) {
      sentences[currentSentence]++;
    }
    input_str++;
  }
  </code></pre>
  
  <p>For some reason on the line sentences[currentSentence]++ valgrind is giving me a 
      Conditional jump or move depends on uninitialised value(s)
  error on that line. I thought that adding in a for loop after malloc that set all the values to 0 would solve this since now they have been initialized to a value, is there a different way that I should be doing that?</p>