[Study Notes 2] The difference between C++ median operation (& |) and logical operation (&& ||)

Bit operations : directly operate on the binary bits of integers in memory;
logic operations : also known as Boolean operations, operate on TRUE and FALSE;

Both & and && mean and, the difference is that && as long as the first condition is false, the subsequent conditions will not be judged.

Both | and || mean "or". The difference is that || as long as the first condition is met, the following conditions are not judged, and | must be judged for all conditions.

Guess you like

Origin blog.csdn.net/weixin_52703185/article/details/120246786