TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: WIM VELDHUIS
from: CAMERON CLARK
date: 1997-07-27 18:20:00
subject: Re: First C++ prog

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.