Its said that using const is better compared to #define...because const identifier uses compiler symbol table..
can some1 please explain why? and How?...
Thanks
|
Mentor
|
![]() |
| 6Apr2010,13:01 | #2 |
|
Lots of answers to and discussions about this online. http://lmgtfy.com/?q=compare+const+define
Why do you need to start yet another thread about it? |
|
Go4Expert Member
|
|
| 6Apr2010,13:10 | #3 |
|
thanks for the reply..i am actually interested in how symbol table comes into the picture for const and #define...
i was googling for it when i came across it..but i didn't find any satisfactory answers.
|
|
Mentor
|
![]() |
| 6Apr2010,13:11 | #4 |
|
const defines a variable which goes into the compiler's symbol table with all other variables. #define is just a lexicographical thing sorted out by the parser; the compiler never sees #defines.
|

