xxxxxxxxxx
// just example for explanation :)
// vector containt strings
vector<string> USERS;
// take string from 'USERS'
// under name 'user' in each time :)
for(string user : USERS){
std::cout << user << std::endl;
}
xxxxxxxxxx
for ( int i = 0; i < 5; i++)
{
cout << "Hello" << endl;
}
// prints hello 5 times.
xxxxxxxxxx
for (int i = start; i < stop; i = i + step){
// statement 1
// statement 2
// etc
}
xxxxxxxxxx
// REMEMBER TO REPLACE '???'
// with the data structure to iterate on
for(int i=0; i<???; ++i) {}
for(auto it=???.begin(); it!=???.end(); ++it) {}
for(auto &obj : ???) {}
xxxxxxxxxx
#include iostream
using namespace std;
int main{
for(int i=0; i<100; i++)
{
cout<<"Hello World";
}
return 0;
}