#define len(a) if (a == 8) 1 \
else if (a == 3) 0 \
else -1
this code is just an example how do we use nested if else. I don't want to use ternary operator as in that case i can't use else if statement.
Don't abuse the preprocessor. Use a real function:
constexpr auto len(int const a) {
if (a == 8) return 1;
if (a == 3) return 0;
return -1;
}
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