const vs. #define

Tamas Szekeres szekerest at GMAIL.COM
Thu Oct 19 12:26:08 EDT 2006


AFAIK the latter is dedicated to the preprocessor and the value will
be included into the code inline. For example when you define an
expression the evaluation will take place as much as you use your
define.
On the other hand the const variable behaves like a variable (read only).

Tamas


2006/10/19, Kralidis,Tom [Burlington] <Tom.Kralidis at ec.gc.ca>:
> Hi,
>
> Are there any rules on using const vs. #define in MapServer source code?
> I've often heard const is preferred, but is also relatively new.
>
> Just wondering...
>
> ..Tom
>



More information about the mapserver-dev mailing list