WV> BM> #define WHEEL_MAX 13
WV> BM> #define STARTING_CASH 300
WV>
WV> TM> const unsigned int WHEEL_MAX = 13;
WV> TM> const unsigned int STARTING_CASH = 300;
WV>
WV>
WV> WV> This is not entirely correct. Compilers usually allocate memory for
WV> WV> something declared as const ...
As far as I've seen, defines are inline replacements done at compile
time. Constants are usually in memory.
To test you compiler. Create an a constant array of bytes and use
lower funtions to move characters using the address of the constant
array. Print the array. You can do the same for a list of constant
bytes. Move 2 bytes to the address of one char and print that char
and the next char to see if the values change.
Note that there may indeed be basic block optimization that uses
the value of a constant rather than the address of a constant, so,
you can't be sure if the value is used as an operand or the address
is used.
--- GEcho 1.00
---------------
* Origin: Digital OnLine Magazine! - (409)838-8237 (1:3811/350)
|