title: Using sizeof on arrays passed as parameters
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1328223/sizeof-array-passed-as-parameter">Sizeof array passed as parameter</a>  </p>
  </blockquote>
  
  
  
  <p>Given the function below I understand that sizeof returns the size of the pointer of the type in the array.</p>
  
  <pre><code>int myFunc(char my_array[5])
  {
      return sizeof(my_array);
  }
  </code></pre>
  
  <p>However calling sizeof on an array not passed as a parameter normally returns the sizeof the array.</p>
  
  <p>What causes this inconsistency? What is the best way of getting the size of an array when it is passed as a parameter?</p>