title: Pointer behaves strangely
body: <p>I'm a programming and c++ novice. I'd appreciate some help with this.</p>
  
  <p>the following program (in c++) doesn't encounter any problem either in compilation or run-time:</p>
  
  <pre><code>int main()
  {
      int b = 5;
      int*a = &amp;b;
      *(a+5) = 6;
      return 0;
  
  }
  </code></pre>
  
  <p>But according to everything I learned it shouldn't work, because a is a pointer to a single variable. What am I missing here?</p>