Range-based for loop in C++

Revision en1, by Kemal, 2016-04-01 16:47:32

Hey there!

I think everyone know what does this piece of code do:

vector <int> v = {1, 2, 3, 4};
for (int x : v)
  cout << x << " ";

prints: 1 2 3 4

Is there any way to do this in reverse order ?!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Kemal 2016-04-01 16:47:32 261 Initial revision (published)