title: Getting the size of a malloc only with the returned pointer
body: <p>I want to be able to vary the size of my array so I create one this way:</p>
  
  <pre><code>int* array;
  array = malloc(sizeof(int)*10);//10 integer elements
  </code></pre>
  
  <p>I can use this like an array as you normally would, however when I try to find the size of it like so:</p>
  
  <pre><code>size = sizeof(array)/sizeof(int);
  </code></pre>
  
  <p>I get the answer 1 because its not recognizing it as pointing to an array</p>
  
  <p>How can I get the size of the array ?
  (I know its not technically an array but is there a way to work out the whole size of the allocated memory block ?)</p>
  
  <p>Also am I right in assuming what I have stated in the description ? If I am technically wrong about something please correct me.</p>