In C language, "a=-a" sets "a" to 0: the unary operator "-" takes the inverse of the expression and changes "a" to "-a". Assign "-a" to "a", changing the value of "a" to 0.
The meaning of a=-a in C language
In C language, a=-a is a Equivalent to the operation of a=0.
Detailed description
Example
<code class="c">int a = 5; // 将 a 设为 0 a = -a; // 现在 a 的值为 0</code>
It should be noted that:
The above is the detailed content of What does a=-a mean in C language?. For more information, please follow other related articles on the PHP Chinese website!