type char is defined as 1. C99 adds support for flexible array members to structures. This form of array declaration is allowed as the last element in structures only, and differs from normal arrays in that no length is specified to the compiler. For a structure named s containing a flexible array member named a, is therefore equivalent to : #include <stdio.h> struct flexarray { char val; int array[]; /* Flexible array member; must be last element of struct */ }; int main(int argc, char **argv) { printf("sizeof (struct flexarray) == %zu\n", sizeof (struct flexarray)); return 0; } In this case the sizeof operator returns the size of the structure, including any padding, but without any storage allowed for the array. Most platforms produce the following output: C99 also allows variable length arrays that have the length specified at runtime, although the feature is considered an optional implementation in later versions of the C standard. In such cases, the sizeof operator is evaluated in part at runtime to determine the storage occupied by the array. #include <stddef.h> size_t flexsize(int n) { char b[n + 3]; /* Variable length array */ return sizeof b; /* Execution time sizeof */ } int main(void) { size_t size = flexsize(10); /* flexsize returns 13 */ return 0; } sizeof can be used to determine the number of elements in an array, by dividing the size of the entire array by the size of a single element: int main (void) { int tab [10]; printf ("Number of elements in the array: %zu\n", sizeof tab / sizeof tab [0]); /* yields 10 */ return 0; } Incomplete types sizeof can only be applied to "completely" defined types. With arrays, this means that the dimensions of the array must be present in its declaration, and that the type of the elements must be completely defined. For structs and unions, this means that there must be a member list of completely defined types. For example, consider the following two source files: /* file1.c */ int arr [10]; struct x {int one; int two;}; /* more code */ /* file2.c */ extern int arr []; struct x; /* more code */ Both files are perfectly legal C, and code in can apply sizeof to arr and . However, it is illegal for code in to do this, because the definitions in are not complete. In the case of arr,