title: Get the length of dynamically allocated array in C
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8269048/length-of-array-in-function-argument">length of array in function argument</a>  </p>
  </blockquote>
  
  
  
  <p>How do I get the length of a dynamically allocated array in C?</p>
  
  <p>I tried:</p>
  
  <pre><code>sizeof(ptr)
  sizeof(ptr + 100)
  </code></pre>
  
  <p>and they didn't work. </p>