What are macros?
- they tell the compiler to substitute an identifier with expressions, statements, or group of statements
- you can think of macros as if they are a way to tell the compiler to replace some code with other code
Why are macros important?
- they make your code easier to read and maintain
Things to note:
- macros can be in same file or included from separate file
- macros allow you to make a change in one location and have the change reflected everywhere else in the program
- macros are more useful with things that are used repeatedly
- read more at http://en.wikipedia.org/wiki/C_preprocessor (Section Macro Definition and Expansion
- read more at http://gcc.gnu.org/onlinedocs/cpp/Macros.html if you want to learn more advance uses of macros