3/18 For const vs. #define thread that someone deleted below, here's my
answer. #define is much more flexible than const. It lets you
take in paramters, or generate a series of function calls (const
will only let you create a value). #define also lets you refer to
other #define's and will accept command line -D arguments passed
into the compiler.
\_ thanks, but I was really asking about the use of #define vs. const
for the specific situation of constant values. obviously #define
can do things that const can't (like macros). (similarly, #define
can do things typedef can't, but typedef clearly is preferable.)
misha's answer was more what I was looking for.
\_ There's No const. There's Only mconst. |