title: C++ Size of Array
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>I am being stupid with this sizeof operator in c++, do you have any idea why it is 4 and 12 ?</p>
  
  <pre><code> void function (int arg[]) {
          cout&lt;&lt;sizeof(arg)&lt;&lt;endl; // 4
      }
  
      int main ()
      {
          int array[] = {1, 2, 3};
          cout&lt;&lt;sizeof array&lt;&lt;endl; // 12
          function (array);
         return 0;
      }
  </code></pre>