|Subject:||RE: Global const in C++|
|Date:||Thu, 9 Nov 2006 12:43:56 +0100|
I do not think that we will have a conclusion here. Preprocessor is part of the compiler, is not it?
#defines are especially handy if there is one value which needs to be compared to signed and unsigned variables for example. So, if you would like to avoid comparison between signed and unsigned warnings and still use the same "fixed value", you need to use defines. Otherwise you use two consts or one const and casting. I disagree if you say that for example (int)variable is a nicer way to do it that use a #define. So, this is how it becomes handy (do not tell me that it never happens, if you say so you never maintained a 25+ years old mixed C/C++ code for sure).
And this is, again, religion.
> S: You misunderstand. And yes, #defines (interpreted by compiler,
Not really ... #defines are handled by the preprocessor and they are
I think _#define_ is for people who learnd C and try to do stuff in C++.
_const_ if for people who like to do efficient and structured programming
|<Prev in Thread]||Current Thread||[Next in Thread>|
|Previous by Date:||Re: serial port question, inflo|
|Next by Date:||Re: Constraining windows re-size, Enrico Thierbach|
|Previous by Thread:||RE: Global const in C++, Malte Witt|
|Next by Thread:||RE: Global const in C++, Malte Witt|
|Indexes:||[Date] [Thread] [Top] [All Lists]|