The bitwise operators in C language are: 1. [&] bitwise AND; 2. [|] bitwise OR; 3. [^] bitwise XOR; 4. [~] negation; 5. [<<] Move left; 6. [>>] Move right.
[Related learning recommendations: C language tutorial video]
The bitwise operators in C language are:
Bitwise operations are unary and binary operations on bitwise or binary numbers in bit mode in programming.
On many older microprocessors, bit operations are slightly faster than addition and subtraction operations, and usually bit operations are much faster than multiplication and division operations.
In modern architectures, this is not the case: bitwise operations often operate at the same speed as addition operations (still faster than multiplication operations).
Bit operators are used to operate on binary bits. Java provides bit operators as shown in the following table: Among the bit operators, except ~, the rest are binary operators.
The operands can only be integer and character data.
Six bitwise operators in C language:
& Bitwise AND
| Bitwise OR
^ Bitwise XOR
~Negation
<< ;Shift left
main() { int a=9,b=5,c; c=a&b; printf("a=%d\nb=%d\nc=%d\n",a,b,c); }
The above is the detailed content of What are the bitwise operators in C language?. For more information, please follow other related articles on the PHP Chinese website!