I want some examples of C preprocessor directives, such as:
#define pi 3.14
#define MAX 100
I know only this.
I want to know more than this, more about preprocessor directives.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The biggest example would be
But there are a fair amount. You can also define macros:
And use header guards
There are proprietary extensions that compilers define to let you give processing directives:
And the if statement cause also be used for commenting:
I often use the preprocessor to make debug builds:
And as everyone else has pointed out there are a lot of places to get more information: