I understand how to use a for loop like
for (x = 0 ; x<5 ; x++ ) { // some_code }
in C++ but what about a for loop like
f
In C++ you can use std::for_each which can be answer for you question. More information you can find here.