What is Comma Operator? Plz Explain What is its Mechanism? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

What is Comma Operator? Plz Explain What is its Mechanism?

https://code.sololearn.com/c5GiTzoTK7BF/?ref=app

25th Jun 2023, 6:38 AM
Rudra
Rudra - avatar
5 Respostas
+ 4
Lisa and Leeroy Mokua there really is a comma operator in C, C++, JavaScript, and other languages (but not Java). https://en.wikipedia.org/wiki/Comma_operator It is mostly used in for loops to insert multiple expressions for initialization and/or the loop update to update multiple variables.
26th Jun 2023, 4:59 AM
Brian
Brian - avatar
+ 3
There is no comma operator. 10 and 20 are ignored, x will be 30. What are you trying to do? Which output do you expect?
25th Jun 2023, 7:05 AM
Lisa
Lisa - avatar
25th Jun 2023, 9:14 AM
Smith Welder
Smith Welder - avatar
+ 2
It's not an operator. Naturally "printf" is a function in the "studio.h" file. And functions take parameters, and if there is more than one parameter they are separated by commas and that's what exactly it is. For more information you can do more research on how the printf works there is alot of information about it out there.
25th Jun 2023, 11:17 PM
Leeroy Mokua
Leeroy Mokua - avatar
+ 1
Brian I guess I also have to do research too.
26th Jun 2023, 6:11 AM
Leeroy Mokua
Leeroy Mokua - avatar