Home  >  Article  >  Backend Development  >  The difference between == and = in c language

The difference between == and = in c language

藏色散人
藏色散人Original
2020-02-10 10:44:4117995browse

The difference between == and = in c language

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.

The difference between == and = in c language

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn