c loop stops when array value is zero not null
<pre><code>int findMax(int*sums){
  int t = 0;
  int max = sums[0];
  while (sums[t] != '\0'){
    printf("current max: %d %d\n", max, sums[t]);
    if (sums[t] &gt; max ){
      max = sums[t];
    }
    t ++;
  }
  return max;
}
</code></pre>

<p>This outputs:</p>

<pre><code>current max: 7 7
current max: 7 4
current max: 7 2
</code></pre>

<p>And its ignoring the rest of the list, <code>sums</code>. I think this is because the next element in <code>sums</code> is <code>0</code>. But I can't see why it would treat <code>0</code> as <code>'\0'</code> (null).</p>