The difference between == and = in c language
In c language == and = have only one meaning There are differences in aspects, as follows:
"==" is a relational operator, while "=" is an assignment operator.
Recommended learning: c language video tutorial
The relational operators in c language are:
1, "!=" means not equal to.
2. "
3. "
4. “> ” means greater than
5. “> =” means greater than or equal to.
Extended information:
Relational operators are all binary operators, and their associativity is left associative. Relational operators have lower precedence than arithmetic operators and higher than assignment operators. Among the six relational operators, , >= have the same precedence, which is higher than == and !=, and == and != have the same precedence.
In C language, some operators have two operands, such as 10 20, 10 and 20 are both operands, and is an operator. We call such operators binary operators. Similarly, an operator with one operand is called a unary operator, and an operator with three operands is called a ternary operator.
Common binocular operators include , -, *, /, etc., unary operators include , --, etc., and there is only one ternary operator, which is ? :.
The above is the detailed content of The difference between == and = in c language. For more information, please follow other related articles on the PHP Chinese website!