Why can’t I use sizeof in a preprocessor condition?

Because sizeof is evaluated at compilation time while directives are evaluated before compilation, and the part that does that is not the compiler, so it won’t understand what sizeof means.

Leave a Comment