title: Why is there a difference in size of bytes between an array and a vector in C++?
body: <p>I'm going through a beginner course on C++ and like to pause the lesson and tinker around with the code on what I'm learning. I had the idea to use the sizeof() operator in C++ on a vector and an array. Ended up finding out that with the same amount of numbers in the vector and array the size of them in bytes comes of different. Here is my code.</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  
  int main()  {
  
     std::vector &lt;int&gt; test_scores { 100,99,90,70,75 };
  
     int test_scores_array[]{ 100,99,90,70,75 };
  
     std::cout &lt;&lt; sizeof(test_scores) &lt;&lt; std::endl;
     std::cout &lt;&lt; sizeof(test_scores_array) &lt;&lt; std::endl;
  
     return 0;
  }
  </code></pre>
  <p>with an output of this</p>
  <pre><code>16
  20
  </code></pre>
  <p>after about 30 minutes of googling I can't figure out why the size is different. I don't really &quot;need&quot; to know but I just find it really interesting that it is different and would really like to know why.</p>