Possible Duplicate:
C++ - enum vs. const vs. #define
Before I used #define
I used to create constants in my main function and pass them where they were needed. I found that I passed them very often and it was kind of odd, especially array sizes.
More recently I have been using #define
for the reason that I don't have to pass constants in my main to each individual function.
But now that I think of it, I could use global constants as well, but for some reason I have been a little hesitant towards them.
Which is the better practice: global constants or #define
?
A side question, also related: Is passing constants from my main as I described a bad practice?