在Leetcode刷题:盛最多水的容器,提交代码有语法错误,自己的编译执行却没问题,求解答?

在Leetcode刷题:盛最多水的容器,提交的代码在vscode里编译执行没问题,但提交的时候说三目运算符的那段代码出错,取出那段代码运行却没问题,求解答?
图片说明

图中代码:

int maxArea(int* height, int heightSize){
    int *l=height,*r=height+heightSize-1;
    int max=0;
    int max_area=(*l<*r?*l:*r)*(r-l);
    while(l<r){
        *l<*r?l+=1:r-=1;
        max=(*l<*r?*l:*r)*(r-l);
        max_area=(max_area>max)?max_area:max;
    }
    return max_area;
}

把这段代码

*l<*r?l+=1:r-=1;

改成这样就可以通过

*l<*r?(l+=1):(r-=1);

但自己执行就不需要改,对于三目运算符的运用测试:
图片说明

求解答

?:优先级是13,+=优先级是14,编译时 就变成了

(*l<*r?l+=1:r)-=1;