title: 'new' operator and typedef-ed arrays in C++
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5339950/is-it-possible-to-dynamically-create-an-array-of-constant-size-in-c">Is it possible to dynamically create an array of constant size in C++?</a>  </p>
  </blockquote>
  
  
  
  <p>This is rather a theoretical question - I wonder why actually operator new[] in C++ returns pointer to first element of array and not actual array (or a pointer to it). This came to me while trying to do something like</p>
  
  <pre><code>typedef int int4[4];
  int4* ni4 = new int4;
  </code></pre>
  
  <p>While I know why this does not work (although it wasn't so clear in the beginning ;)), it really bugs me that code, which in principle is <code>A* ptr= new A;</code> does not compile. Am I the only one that finds that weird?</p>