+ 2

What are comma operators used for?

They can be used in two ways 1 to seperate two expressions 2 to combine a block Like,. Int a=( a=2,b=3,a+b); cout<<a; Output:5 Here, i want to know some better applications in practical programs..

22nd Mar 2019, 3:51 PM
nikita mishra
nikita mishra - avatar
2 odpowiedzi
+ 6
The commas are used to separate your parameters, variables, ect.
22nd Mar 2019, 4:39 PM
D_Stark
D_Stark - avatar
0
Comma operator works from left to right, if used consequently. It assign values from left.
8th May 2019, 7:31 AM
Jainendra Kumar
Jainendra Kumar - avatar