mardi 27 juin 2017

How to take into the account part of condition inside the condition only if some value is true

I'm trying to understand how it is possible to put condition inside condition itself.

for example, below I'm showing wrong unreal code, but clear to understand what I'm asking for without extra words:

  if (a == 1 && if (b == 1) { c >= 5 })
  {
     /// process
  }

So condition c == 1 must be taken into the account for process only in case if b == 1 which must be exist inside one statement without using of separate function with separate conditions or as condition after condition.

Question is how take part of condition into the account inside the condition only in case if some value is true and avoid it if false and read only a == 1.

Aucun commentaire:

Enregistrer un commentaire