Nested Counter-Controlled for Statements

We could have implemented the nested loop with counter-controlled repetition as follows:

for ( size_t row = 0; row < a.size(); ++row ){   for ( size_t column = 0; column < a[ row ].size(); ++column )      cout << a[ row ][ column ] << ' ';   cout << endl;} // end outer for

Get C++11 for Programmers, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.