title: C++ - the count of the array is irrelevant to the declared size
body: <p>I have written the following code block. But the size of the array returned by <code>sizeof()</code> is irrelevant. I have an array of 6 elements while the <code>sizeof()</code> returns 24 as the size of the array. </p>
  
  <p>Here is the code:</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
      int arr[6] = { 0, 5, 8, 32, 100, 41 };
      int arrSize = sizeof(arr);
      int i = 0;
      cout &lt;&lt; "This is the Size of Array: " &lt;&lt; arrSize &lt;&lt; endl;
      /*
      for (i = 0; i &lt; arrSize; ++i)
      {
        cout &lt;&lt; arr[i] &lt;&lt; endl;
      }   */
  
      return 0;
  }
  </code></pre>
  
  <p>And here is the Output:</p>
  
  <pre><code>This is the Size of Array: 24
  </code></pre>