operator ==不能应用于bool类型为int的操作数 [英] operator == cannot be applied to operands of type int to bool
本文介绍了operator ==不能应用于bool类型为int的操作数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我收到此错误,请给我解决方案。
regrds,
Ravinderreddy
hi i am getting this error please give me the solution.
regrds,
Ravinderreddy
推荐答案
如错误消息所示,您无法将这两种类型进行比较。
如果整数是1或0,请尝试将其转换为布尔值,然后再次进行比较。
As the error messages suggest, you cannot compare these two types together.
If the interger is either a 1 or 0, try converting it to boolean and then do the comparision again.
这篇关于operator ==不能应用于bool类型为int的操作数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文