title: Behavior of Arrays in a Loop
body: <p>Im new to this forum and I want to ask why it is that the behavior of this array Im making is different from I expected it to be?.</p>
  
  <pre><code>int main() {
      int array[8]={3,5,5,6,6,5,3,5};
      for(int i=-1;i&lt;=8;i+=2) {
          std::cout&lt;&lt;array[i+1];
      }
  
      return 0;
  }
  </code></pre>
  
  <blockquote>
    <p>The output of this is: 35637</p>
  </blockquote>
  
  <p>I didn't know why the result is like this especially the last part in the index 8 which is the value is 7...</p>