title: Element count of an array in C++
body: <p>Let's say I have an array <code>arr</code>. When would the following not give the number of elements of the array: <code>sizeof(arr) / sizeof(arr[0])</code>?</p>
  
  <p>I can thing of only one case: the array contains elements that are of different derived types of the type of the array.</p>
  
  <p>Am I right and are there (I am almost positive there <em>must</em> be) other such cases?</p>
  
  <p>Sorry for the trivial question, I am a Java dev and I am rather new to C++.</p>
  
  <p>Thanks!</p>