Excerpt from TopCoder article:
The expression
sizeof(data)/sizeof(data[0])returns the size of the arraydata, but only in a few cases, so don’t use it anywhere except in such constructions.(C programmers will agree with me!)
To get array size, I've been using this expression sizeof(data)/sizeof(data[0]) all the time for all primitive types.
Does anyone know about any such case in which the above expression should not be used?
 
     
     
    