我不明白这个c表示法
有人可以解释这种陈述吗?我没有明白。
data[i] = ((data[i] == div[i]) ? '0' : '1');
Can someone explain this kind of statement(s)? I didn't get it.
data[i] = ((data[i] == div[i]) ? '0' : '1');
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个If-Else语句,但是条件运营商的空间更少,并有助于以最短的方式编写IF-ELSE语句。
因此,可以将您的表达方式可视化到If-else语句中为:
**'?:'需要三个操作数来工作,因此它们也称为三元运营商。
It's an if-else statement but the conditional operator takes less space and helps to write the if-else statements in the shortest way possible.
So , your expression can be visualized into if-else statement as:
** ‘?:’ takes three operands to work, hence they are also called ternary operators.