Friday, 9 September 2011

Comma operator

Comma operator ( , )
  • Evaluate of comma operator- Left to right.
  • Uses of comma operator as following :
    1. Multiples declaration
    2. Multiples initialization
    3. Multiples variation
    4. Multiples statement 
  • Example of comma operator
    1. int x=0,y=1,z=2;
    2. for(x=0 , y=1, z=2 ; condition1 , condition2 ;increment/decrement)

No comments:

Post a Comment