-3
#include"studio.h"
void main() {
int i , j= 0, k;
k = i = 2 , j; // what's meaning of int , int ?
printf ( "%d", k );
}

can anyone please explain what's up with that int , int ..?

MasterMastic
  • 20,711
  • 12
  • 68
  • 90
blaze
  • 13
  • 1
  • 1
  • 5

1 Answers1

1

The comma operator allows you to evaluate a second expression. (a, b) returns the value of expression b.

However, because the = has a higher priority than the comma operator, the values of i, j and k are respectively 2, 0 and 2.

Maxime Chéramy
  • 17,761
  • 8
  • 54
  • 75