Home >Backend Development >C#.Net Tutorial >What is & symbol in C language?
In C language, the & symbol represents the bitwise AND operator. It operates bitwise on two bit patterns, and if both bits are 1, the result is 1; otherwise, the result is 0. The bitwise AND operator is used to set or clear specific bits, test the state of bits, and combine bit patterns.
What does the & symbol mean in C language?
In C language, the & symbol is the bitwise AND operator. It is used to logically AND the corresponding bits in two bit patterns.
Bitwise AND operation
The bitwise AND operation symbol & operates on each corresponding bit. If both bits are 1, the result is 1; otherwise, the result is 0.
For example:
1101 & 1010
will produce the result:
1000
because:
1 & 1 = 1
1 & 0 = 0
0 & 1 = 0
1 & 0 = 0
Usage
The bitwise AND operator is often used for the following purposes:
The above is the detailed content of What is & symbol in C language?. For more information, please follow other related articles on the PHP Chinese website!