title: What's the precedence of comma operator inside conditional operator in C++?
body: <p>What's happening here? </p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main(){
  
      int x=0,y=0;
      true? ++x, ++y : --x, --y; 
      cout &lt;&lt; "x: " &lt;&lt; x &lt;&lt; endl;
      cout &lt;&lt; "y: " &lt;&lt; y &lt;&lt; endl; //why does y=0 here?
  
      x=0,y=0;
      false ? ++x, ++y : --x, --y; 
      cout &lt;&lt; "x: " &lt;&lt; x &lt;&lt; endl;
      cout &lt;&lt; "y: " &lt;&lt; y &lt;&lt; endl;
  }
  
  x: 1
  y: 0
  
  x: -1
  y: -1
  </code></pre>
  
  <p>The second case seems fine. I would expect both x and y to increment to 1 in the first case but only the left hand operand increments. </p>