I’m looking at something like this:
#define foo(x) \
(((a > b) ? \
0 : 1), \
(c ? 2 : 3), \
(d ? 4 : 5))
I’m not sure how to interpret this. Can someone help me out?
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.
Essentially the
\ignores the newline as far as terminating the#definestatement is concerned, so each time you writefoo(var)in your code it will be replaced withThe comma operator doesn’t do a whole lot, except the final “returned” value of a statement consisting of statements separated by comma operators is the right most value.
All of that being explained, this isn’t really a terribly valid
#definesince you usea,b,c, anddin the#defineand only referencexas a parameter