Here we'll study how can we check multiple conditions in a single if statement. This can be done by using 'and' or 'or' or BOTH in a single statement. and comparison = for this to work normally both conditions provided with should be true. If the first condition falls false, the compiler doesn't check the second one.
You can specify multiple conditions in a single WHERE clause to, say, retrieve rows based on the values in multiple columns. You can use the AND and OR operators to combine two or more conditions into a compound condition. AND, OR, and a third operator, NOT, are logical operators.
#if defined(CONDITION1) || defined(CONDITION2)
should work. :)
#ifdef
is a bit less typing, but doesn't work well with more complex conditions
May use this-
#if defined CONDITION1 || defined CONDITION2
//your code here
#endif
This also does the same-
#if defined(CONDITION1) || defined(CONDITION2)
//your code here
#endif
Further-
#if defined CONDITION1 && defined CONDITION2
#if defined CONDITION1 ^ defined CONDITION2
#if defined CONDITION1 && !defined CONDITION2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With