TITLE: Optimizing const declarations PROBLEM: pcs$1304@altair.selu.edu (Todd Bowers) Just to add a little more info: - true const declarations are permanently stored in the data segment. - true const declarations are also require memory references when used, again, not so bad unless you've got a lot of 'em. #define constants are actually text that the compiler inserts into the code as its compiling, just as if you had typed the literal value there yourself. RESPONSE: steve@taumet.com (Steve Clamage), 14 May 93 Not necessarily so. Most compilers will optimize away the storage. Most compilers will use const items in exactly the same way as literals. The language explicitly allows these optimizations. When used in the same way as simple macros, you will normally get identical code for const variables. I don't know of any advantage in using a simple macro for a literal over using a const variable.