title: How to find out what the size of dynamically allocated array is(using sizeof())?
body: <p>how could I find out the size of dynamically allocated array?
  With normal array using the method below works fine, but I can't do the same thing with dynamically allocated array. Please, have a look and thanks for your help.</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  
  int main() {
      //normal array
      int array[5];
      cout &lt;&lt; sizeof(array)/sizeof(array[0]) &lt;&lt; endl; //this outputs the correct size
  
      //dynamically allocated array
      int *dArray = new int[5];
      //how to calculate and output the size here?
  
      return 0;
  }
  </code></pre>