I want to count the elements so if the server sends a bad item id it won't crash every client in range lol. I heard that the sizeof keyword returns the size of the array in bytes. I used to think the sizeof keyword would return the element count but found out it isn't.
Using sizeof with class member arrays does give the length. sizeof(array) / sizeof(*array).
It only doesn't work if the class is a variable length struct and the array is the variable length part.