If I have two integer values I can test for equality simply:
if (a == b)
if I have three integer values then I could do something like:
if ((a == b) && (a == c) && (b == c))
I've got a situation where I've got 6 values to test for equality, this approach is going to get verbose
Is their a better, and more C idiomatic (c-onic?) means to achieve this?
actually, just having written this I can see that:
if ((a == b) && (b == c) && (c == d)... )
is logically ok, i.e. you don't need all the combinations as a == b
and b == c
implies a == c
But in terms of clarity of expression how close can I get to:
if (a == b == c)
?