the code does not specify the dimension of the array; without this information, the compiler has no way of knowing how many elements are in the array, and cannot calculate the array's overall size. Likewise, the compiler cannot calculate the size of because it does not know what members it is made up of, and therefore cannot calculate the sum of the sizes of the structure's members (and padding). If the programmer provided the size of the array in its declaration in , or completed the definition of by supplying a member list, this would allow the application of sizeof to arr or in that source file. Object members C++11 introduced the possibility to apply the sizeof parameter to specific members of a class without the necessity to instantiate the object to achieve this. The following example for instance yields and on most platforms. #include <iostream> struct foo { int a; int b; }; int main () { std::cout << sizeof foo::a << "\n" << sizeof (foo) << "\n"; } Variadic template packs C++11 introduced variadic templates; the keyword sizeof followed by ellipsis returns the number of elements in a parameter pack. template <typename... Args> void print_size (Args... args) { std::cout << sizeof... (args) << "\n"; } int main () { print_size (); // outputs 0 print_size ("Is the answer", 42, true); // outputs 3 } Implementation When applied to a fixed-length datatype or variable, expressions with the operator sizeof are evaluated during program compilation; they are replaced by constant result-values. The C99 standard introduced variable-length arrays (VLAs), which required evaluation for such expressions during program execution. In many cases, the implementation specifics may be documented in an application binary interface (ABI) document for the platform, specifying formats, padding, and alignment for the data types, to which the compiler must conform. Structure padding When calculating the size of any object type, the compiler must take into account any required data structure alignment to meet efficiency or architectural constraints. Many computer architectures do not support multiple-byte access starting at any byte address that is not a multiple of the word size, and even when the architecture allows it, usually the processor can fetch a word-aligned object faster than it can fetch an object that straddles multiple words in memory. Therefore, compilers usually align data structures to at least a word boundary, and also align individual members to their respective boundaries. In