Quiz 36
Anonymous
2,271 views
description:
The operands to the comma operator are evaluated from left to right. The value of the left hand expression is discarded. The type and value of the result are the type type and value of the right hand operand. Note: assignment takes precedence over the comma operator, so in this case x=1 is evaluated first; than x, 2, 3
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
int main(int argc, char** argv)
{
int x;
x = 1, 2, 3;
std::cout << x << std::endl;
return 0;
}
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.