Clive Crous wrote:
>
> hmmmm
>
> I thought #define's where "pre-processed"
> ie
> i want to do this:
> ---
> #define MYDEF (3*4)
> ---
> and when i use "MYDEF" in the code it must put in a "7" not a "(3*4)"
> is there a way to do this ?
> why should I have computations done at run time, when they could be done at
> compile time
#defines do exactly what it says, simple substitutions, nothing more.
(I think it also replaces hex and oct constants with decimal).
The 3*4 will be replaced by 12, but the compiler will do that, not
the preprocessor.
Martijn