c++ - Two equivalent if conditions give different results -
i encountered problem when developing project , don't know how proceed debug this. code is (_vtol_status.vtol_in_rw_mode true)
bool a; if (_vtol_status.vtol_in_rw_mode == true){ = true; } else { = false; } bool b = true; if (a == b) {/* print */} if (a) {/* block of codes */}
i can see "something" printed true. block of codes doesn't give correct result. have made sure enters "if (a)".
however if change if condition to
if (b) {/* block of codes */}
then works well.
i have made sure variables "a" , "b" appear else in code.
how possible? have been struggling long time. issue might simple couldn't clue. appreciated.
wiki
Comments
Post a Comment