lundi 22 mars 2021

What if the variable gets modified inside the if loop?

I have a simple if-else loop and I am checking a variable to get inside the if loop, but under certain conditions, the variable gets modified in the if loop. My question is, after the execution of if, and if the variable is modified will the program enter the else?

bool check = true

if (check)
{
  ...
  ...
 check = false;
}

else{
...//some other code
}

will the else get executed immediately after if?

Aucun commentaire:

Enregistrer un commentaire