title: My char pointer points to invalid value after being cast from int*
body: <p>I am learning C programming language, I have just started learning <strong>arrays with pointers</strong>. I have problem in this question, I hope the that output must be <strong><code>5</code></strong> but it is <strong><code>2</code></strong>, Can anyone please explain why?</p>
  
  <pre><code>int main(){
     int arr[] = {1, 2, 3, 4, 5};
     char *ptr = (char *) arr;
     printf("%d", *(ptr+4));
     return 0;
  }
  </code></pre>