三目运算符总是提示错误:error: not a statement

2025-04-17 13:38:49
推荐回答(1个)
回答1:

三目运算符,其实是有返回值的,可以理解为: if(a){ return b;}else{ return c;}所以直接写的话是会报编译错误的