Why use #define?
What is the use of using #define and defining a value when I can just put in the value when it is needed in my code. Isn't it just an extra line doing nothing in particular?
|
Possibly, but consider readability and user-friendly code. If you're using a particular value many times throughout your code, for example an important geometry length (diameter of a pipe), and would like to adjust this value then you only need to alter the value in one convenient location (top of the document) instead of throughout your code.
|
All times are GMT -4. The time now is 04:19. |