TITLE: using const versus define PROBLEM: Frederic Thomas <101350.612@CompuServe.COM> Basically, it depends what you want to do. The main difference between const and #define, especially for non-strings types, is that a const uses room in the data segment (i.e. is equivalent to a global), which can be annoying under 16bits. RESPONSE: clamage@Eng.Sun.COM (Steve Clamage), 5 Dec 95 That is not necessarily so. For example: const int size = 512; char buf[size]; ... cout << "The buffer has " << size << " bytes\n"; for(int i = 0; i < size; ++i ) { ... } In this example, there is no requirement that "size" be allocated any data space. Since its address is not required, the compiler need not create an actual variable, but can simply substitute the value 512 where ever "size" is mentioned -- the same as it would do if "size" were a macro. Most compilers do in fact avoid allocating any space for "size" when it is more efficient not to do so. I don't know of any situations where the compiler must generate less efficient code when you use a const than when you use a macro.