say I have an if statement as such
if(condition1 || condition2 || condition3)
{
//do something
}
Is it possible to find out which of the 3 conditions was true when we enter the loop?
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.
Yes, you can check each one individually with something like:
assuming of course that the conditions aren’t likely to change in the interim (such as with threading, interrupts or memory-mapped I/O, for example).