You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When applied to an array, the result is the total number of bytes in the array. This implies that the size of an array of n elements is n times the size of an element.
That's the intent, but it's not implied by the other rules we specify, and starting this sentence with "This implies that" makes it sound like it's not adding a normative requirement, which it is. I think this is implied (weakly) for arrays of class types, where we say:
When applied to a class, the result is the number of bytes in an object of that class including any padding required for placing objects of that type in an array.
But even that doesn't seem to disallow, say, allocating some constant amount of extra space at the start of the array to store a bound.
Perhaps:
When applied to an array, the result is the total number of bytes in the array. This implies that the size of an array of n elements, the result is n times the size of an element.
? The "the result is the total number of bytes in the array" part seems redundant anyway, given p1:
The sizeof operator yields the number of bytes occupied by a non-potentially-overlapping object of the type of its operand.
The text was updated successfully, but these errors were encountered:
We have:
That's the intent, but it's not implied by the other rules we specify, and starting this sentence with "This implies that" makes it sound like it's not adding a normative requirement, which it is. I think this is implied (weakly) for arrays of class types, where we say:
But even that doesn't seem to disallow, say, allocating some constant amount of extra space at the start of the array to store a bound.
Perhaps:
? The "the result is the total number of bytes in the array" part seems redundant anyway, given p1:
The text was updated successfully, but these errors were encountered: