如何检查条件是真还是假 [英] How can I check a condition is true or false
本文介绍了如何检查条件是真还是假的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要检查程序中的条件是真还是假
Hi,
I need to check a condition is true or false in the program
if (m=(f1 + 1)-(k - 1))
但是在编写代码时,它显示出一些错误说不能从int转换为bool
如何解决这个问题???
谢谢
John
But while writing the code it is showing some error saying cannot convert from int to bool
How can I solve this problem???
Thanks
John
推荐答案
尝试将您的运算符更改为double equals。 />
单个相等用于分配,双倍用于比较。
Try changing your operator to double equals.
Single equal is used for assigning, double for comparison.
if (m==(f1 + 1)-(k - 1))
...希望它有所帮助。
... hope it helps.
这篇关于如何检查条件是真还是假的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文