mardi 30 janvier 2018

Strange if-else condition calling

Please help me go through this :

print("%i", session.subsessions.count)    // prints 3
print("%i", self.iSessionNumber)          // prints 6
print("%i", self.sessions.count - 1)      // prints 6
if session.subsessions.count > 1 || self.iSessionNumber == self.sessions.count - 1
{
    // if called
}
else
{
    // else called
} 

Clearly, if condition should be called. But strangely, else is getting called. No idea why

Aucun commentaire:

Enregistrer un commentaire