title: Calculation of Array size using sizeof()
body: <p>Excerpt from TopCoder <a href="https://www.topcoder.com/community/data-science/data-science-tutorials/power-up-c-with-the-standard-template-library-part-1/#summary" rel="nofollow noreferrer">article</a>: </p>
  
  <blockquote>
    <p>The expression <code>sizeof(data)/sizeof(data[0])</code> returns the size of the array <code>data</code>, but only in <strong>a few cases</strong>, so don’t use it anywhere except in such constructions.(C programmers will agree with me!) </p>
  </blockquote>
  
  <p>To get array size, I've been using this expression <code>sizeof(data)/sizeof(data[0])</code> all the time for <strong>all primitive types</strong>.</p>
  
  <p>Does anyone know about any such case in which the above expression <strong>should not</strong> be used? </p>