title: return reference to element of dynamic array in C++?
body: <p>Is this is how you return a reference to an element of a dynamically allocated array with index i ??</p>
  
  <pre><code>    int&amp; dynamic_array::operator[](unsigned int i) {
      if (i &gt;= get_size())
          throw exception(SUBSCRIPT_RANGE_EXCEPTION);
      else
          return array[i];
  }
  </code></pre>