lundi 23 août 2021

C++ logical conditions inside if statements

int a = 2;

if((a = a-3 && --a ) || a--) 
    cout<<a<<endl;

How is the output for this code 1? What is happening under the hood? Is it like only one side of the if statement is executed?

Aucun commentaire:

Enregistrer un commentaire