+ 2
How is this even working with "," instead of ";" i even ran this code on PC and it worked???Help Please
8 Answers
+ 5
Not as a delimiting... It is an operator(like an evaluator).
Consider the next expresion:
int a=0,b=1,c; //Here it is a separator.
c = (a++, b+1); //Here is an operator.
cout << c << endl; //outputs: 2
cout << a << endl; //outputs: 1
It can be a perfect quiz...
+ 5
It is a little confusing... So i leave you the link.
https://www.tutorialspoint.com/cplusplus/cpp_comma_operator.htm
+ 5
You're Welcome! 💪
+ 3
It is called Comma Operator... And it is also used to evaluate two or more expressions, returning the last expression as the resulting value. Either way, it executes the other instructions.
+ 2
can u elaborate it more please?
+ 1
well Thanks for the link.... i opened it but still iam confused how does comma is used as a line terminator?
+ 1
😅😅🤔🤔🤔
+ 1
i get it ...but not that much 😅 still thanks for ur efforts 😇