The result of applying sizeof depends in part on the type involved:
*) sizeof char or an expression of type char is guaranteed to be 1.
*) sizeof a reference type returns the size of an object of the referenced type.
*) sizeof a pointer returns the size needed hold a pointer.
*) sizeof a dereferenced pointer returns the size of an object of the type to which the pointer points; the pointer need not be valid.
*) sizeof an array is the size of the entire array. It is equivalent to taking the sizeof the lement type times the number of elements in the array. Note that sizeof does not convert the array to a pointer.
*) sizeof a string or a vector returns only the size of the fixed part of these types; it does not return the size used by the object's elements.
C++11:
Under the new standard, we can use the scope operator to ask for the size of a member of a class type. Ordinarily we can only access the members of a class through an object of that type. We don't need to supply an object, because sizeof does not need to fetch the member to know its size.