Would you like to learn about the operator "," in C and C++?

Asked

Viewed 24 times

0

I will put the example of a code I saw below:

while(scanf("%d %d %d %d", &h, &u, &d, &f), h) {...

}

the input stopped when h received value 0.

  • There is the comma operator. In the question example, the comma is used in two situations: as the argument separator in the function’s application list and as the operator itself (already linked at the beginning of this comment).

  • @Luizfelipe If I understood from what he said in the question he refers to the comma out of the past arguments, refers to the , h, of course the result of h is determined by what is passed in scanf.

  • The operator is the same, no matter where it is used, the location can change specific aspects. If you have a more specific question about this situation there is different, and it would lack clarity about what this question is, the question would need to be reformulated.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.