return statement in ternary operator c++

前端 未结 5 1457
不知归路
不知归路 2020-12-02 23:01

I wrote the absolute function using ternary operator as follows

int abs(int a) {
 a >=0 ? return a : return -a;
}

I get the following er

5条回答
提交回复
热议问题