C++

Objectives :

  • File name: comma_operator1.cpp
  • The comma operator in C++  has right to left precedence in this equation i= (n1,n2,n3).
  • The comma operator in C++  has left to right precedence in this equation i=  n1,n2,n3.
  • Code : comma_operator1.txt

 

 

Step: 1 Create a source file.

Step: 2 Edit and save Source file

Step: 3 Runtime Views:

Step: Brief Discussion: Set few break points as shown below, press F10 key to trigger "Step To Cursor " debugging, and note that integer variable "i" gets the right most (last) value from this equation i = (n1, n2), where comma operator separated two variables as shown below.