Jul 12, 2013 at 10:44am UTC
This is my first post, so I wanted to say what's up to everyone! Secondly, if the following question has been answered on the forum, can you direct me to it. Thank you. Here it is...
I'm new to using preprocessor directives and have a question on using #define.
When defining an identifier, do you need a replacement?
Here is the code from my constants.h file I am writing from a book...
1. #ifndef _CONSTANTS_H
2. #define _CONSTANTS_H
4. //All my constants go here
See how there is no "replacement" in line two, only the identifier. How does this work?
Jul 12, 2013 at 12:35pm UTC
You don't need a "replacement". When doing include guards you are only interested if the macro has been defined or not. What it has been defined as is not important because it is normally never used in such a way that it will be expanded.