Home > Article > Backend Development > What does & mean in C language?
What does & mean in C language? The
& symbol has two meanings in C language. One represents the address operator, which is a unary operator. Its function is to obtain the memory address of a variable; while the other represents It is a bitwise operator and a binary operator. Its function is to AND the corresponding binary bits of two numbers.
C language operators
Arithmetic operators
are used for various numerical operations. There are seven types including addition ( ), subtraction (-), multiplication (*), division (/), remainder (or modular operation, %), autoincrement ( ), and autodecrement (--).
Relational operators
are used for comparison operations. It includes six types: greater than (>), less than (<), equal to (==), greater than or equal to (>=), less than or equal to (<=), and not equal to (!=).
Logical operators
are used for logical operations. Including and (&&), or (||), not (!).
Bit operation operator
The quantities involved in the operation are operated in binary bits. It includes six types: bitwise AND (&), bitwise OR (|), bitwise NOT (~), bitwise XOR (^), left shift (<<), and right shift (>>).
Assignment operator
is used for assignment operations, which are divided into simple assignment (=), compound arithmetic assignment (=,-=,*=,/=,%=) and compound bit operations There are eleven types of assignments (&=,|=,^=,>>=,<<=) in three categories.
Conditional operator
This is a ternary operator used for conditional evaluation (?:).
Comma operator
is used to combine several expressions into one expression (,).
Pointer operator
is used for two operations: content (*) and address (&).
The byte count operator
is used to calculate the number of bytes occupied by the data type (sizeof).
Special operators
include brackets (), subscripts [], members (→,.), etc.
Recommended tutorial: "C#"
The above is the detailed content of What does & mean in C language?. For more information, please follow other related articles on the PHP Chinese website!