Condition in for loop of C -


I have created a typo today, and then the code below can be compiled successfully:

< Pre> # include & lt; Stdio.h & gt; Int main () {int i; For (i = 0; 1,2,3,4,5; i ++) printf ("% d \ n", i); }

I can not understand why

  1,2,3,4,5  

may be Is it considered as a condition?

You are using Comma operator 1, 2 , The value of 3, 4, 5 is 5.

More commonly, the value of a, b is b . In addition, the value of f (), g () is of g () , but both subexpressions f () and G () is evaluated, so both functions are called.


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -