Constant Expressions

A constant expressions can be evaluated during translation rather that runtime and accordingly may be used in any place that a constant may be.

Constant expressions can consist only of the following:

Constant expressions cannot contain any of the following operators, unless the operators are contained within the operand of a sizeof operator: assignment, comma, decrement, function call, increment.

Each constant expression can evaluate to a constant that is in the range of representable values for its type.

Constant expression can be used anywhere a constant is legal.

Copyright (c) 2002-2012 mikroElektronika. All rights reserved.
What do you think about this topic ? Send us feedback!
Want more examples and libraries? 
Find them on LibStock - A place for the code