Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以将测试结果直接分配给变量?
我想做类似的事情
c = ( a == b )
代替
if ( a == b ) { c = true; } else { c = false; }
这可能吗?
是的当然。
您可以很容易地使用编译器对其进行测试。
int a = 1, b = 2; bool c = a == b;