title: C - sizeof int array always returns 4
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1898657/sizeof-array-of-structs-in-c">sizeof array of structs in C?</a><br>
    <a href="https://stackoverflow.com/questions/8250829/sizeof-an-array-passed-as-function-argument">sizeof an array passed as function argument</a>  </p>
  </blockquote>
  
  
  
  <p>Just trying to write a basic <code>sum()</code> function.</p>
  
  <pre><code>int sum(int arr[]) {
      int total = 0 , i = 0 , l = sizeof arr;
  
      for(i=0;i&lt;l;i++) {
          total += arr[i];
      }
  
      return total;
  }
  </code></pre>
  
  <p><code>l</code> always equates to 4 (I know to eventually divide it by <code>sizeof int</code>)</p>
  
  <p>Running Dev-C++ with default compiler options in Windows 7.</p>