Correct :)
In a for loop i++ and ++i are exactly the same. But here is an example to understand them better:
i = 5;
a = i++;
b = i;
VS
Type: Posts; User: C_ntua
Correct :)
In a for loop i++ and ++i are exactly the same. But here is an example to understand them better:
i = 5;
a = i++;
b = i;
VS
If I understand correctly you want something like this:
for (int i = 0; i < 5; ++i)
{
std::cout << "Hey, dude" << std::endl;
}
which will print 5 times "Hey, dude". The loop works like...