Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  About C++ comma operator precedence

When learning programming language, we will always have one topic about the operator precedence. Since there are many operators can be used in one expression, there should be some rules regarding which operation can happen first so that the compiler or interpreter can handle them correctly. One rule of programming with expression is using as much as brackets as you can to avoid unexpected results.Here we refer one problem we see online about the comma operator in C++. The following program has the result which some people may feel strange.The first code snippet:01020304050607080910void main ()...

6,032 1       COMMA PRECEDENCE