Is sizeof in C++ evaluated at compilation time or run time?

ogzylz picture ogzylz · Apr 11, 2010 · Viewed 27.8k times · Source

For example result of this code snippet depends on which machine: the compiler machine or the machine executable file works?

sizeof(short int)

Answer

Billy ONeal picture Billy ONeal · Apr 11, 2010

sizeof is a compile time operator.