XOR operation

Is it possible to solve this by XOR operation?

1
2
3
4
5
6
7
8
9
10
11
12
setts.view.rotation_315 = IsDlgButtonChecked(dialog,IDC_V_MROTATION_315);
setts.view.rotation_45 = IsDlgButtonChecked(dialog,IDC_V_MROTATION_45);      
      if ( ( !setts.view.rotation_315 && !setts.view.rotation_45 ) ||
           ( setts.view.rotation_315 && setts.view.rotation_45 ) 
          )
        {
        setts.view.rotation_0 = true;
        setts.view.rotation_45 = false;
        setts.view.rotation_315 = false;
        }
      else
        setts.view.rotation_0 = false;


When both checkboxes are checked or they are not checked at all set setts.view.rotation_0 to false.
if both view.rotation_X are bools, setts.view.rotation_0 = setts.view.rotation_315 ^ setts.view.rotation_45; should work
Perhaps !(foo^bar)
Thanks for both replies
Topic archived. No new replies allowed.