title: c++ char array returns some strange value
body: <p>After inserting values in dynamic char array, trying to get first value from the top. Method gives me back <strong>²</strong> value.
  Can you help me with understanding, what I am doing wrong? Here is main method:</p>
  <pre><code>    char* arr = new char[5]();
      arr[0] = 'h';
      arr[1] = 'e';
      arr[2] = 'l';
      arr[3] = 'l';
      char result = topValue(arr, 5);
      cout &lt;&lt; result;
  </code></pre>
  <p>Here is <strong>topValue()</strong> method:</p>
  <pre><code>char topValue(char* stackArr, int stackSize)
  {
      for (int i = stackSize; i &gt;= 0; i--)
      {
          std::cout &lt;&lt; &quot;In top: &quot; &lt;&lt; stackArr[i] &lt;&lt; std::endl;
          if (stackArr[i] != '\0')
          {
              return stackArr[i];
          }
      }
  } 
  </code></pre>