2

I saw someone use (b, c) in C.

I tested it like:

printf("%d\n", (0, 0));
printf("%d\n", (0, 1));
printf("%d\n", (1, 0));
printf("%d\n", (1, 1));

the result is:

0
1
0
1

but still dunno why it only output value c.

Could someone let me know what the operator is?

Ca Chen
  • 63
  • 8
  • It's the comma operator. It's typically used in a `for` loop, to perform multiple assignments in one of the sections of the `for` statement. – Tom Karzes Sep 29 '21 at 11:59

0 Answers0