Thursday, February 7, 2013

why sizeof is not a function but an operator

Sizeof needs to be an operator, since it should be evaluated at the compile time. Functions will be executed only at the run time. If sizeof is implemented as a function, then operations depending upon sizeof would fail (like static memory allocation using sizeof).

No comments:

Post a Comment