You are here

Multiple Items in the Initialization and Update

10 February, 2015 - 12:21

The following shows the use of the sequence operator to separate the multiple initializations and multiple updates. This is not available in most languages, thus is more unique to the C++ programming language.

Example 15.3: C++ source code: for with multiple initializations and updates

for(x =0, y=l0; x  <  l0; x++, y--)   {   cout «  x*y «  endl;   }