小编Saj*_*hir的帖子

在使用 C++ 赋值时理解运算符“更少”或“更大”

我使用了大于和小于符号,它给出了输出!它是如何工作的?

int x = 2;
x >= 3;
cout << x;  // output is 2
Run Code Online (Sandbox Code Playgroud)

而且输出也是不同的

int x = 2;
x = x > 3;
cout << x;   // output is zero !! HOW ??
Run Code Online (Sandbox Code Playgroud)

c++ bitwise-operators assignment-operator comparison-operators relational-operators

1
推荐指数
1
解决办法
70
查看次数