I wonder if this would be a bad idea to makes such defines in C:
#define and &&
#define or ||
#define not !
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.
It would definitely be a bad idea to do this yourself.
If you really want names like
andinstead of symbols like&&, you can include the<iso646.h>C Standard Library header, which defines several named operators, including the three you mention.In C++, the alternative representations (like
andandor) are operators built into the language, so you don’t need to include any header to use them, and it isn’t possible to define them as macros (a macro name must be an identifier, and the alternative representations are operators, not identifiers, even during preprocessing).