If-elseif-else Logic Question

Posted by Changeling on Stack Overflow See other posts from Stack Overflow or by Changeling
Published on 2010-06-10T14:09:33Z Indexed on 2010/06/10 14:12 UTC
Read the original article Hit count: 326

I have a set of three values, call them x, y, and z. If value A happens to match only one in the set x, y, and z, then that means we have a proper match and we stop searching for a match, even if it is at y. It can match any one in that set. These values x, y, and z are non-constant so I cannot use a switch-case statement.

How do I do this with an if-elseif-else statements without having to use GOTO. I am using C++ (no boost or any of that other fancy stuff).

Now, I am trying to do this in code and it is racking my brain this morning (not enough coffee?)

© Stack Overflow or respective owner

Related posts about c++

Related posts about if-statement