Search:

Type: Posts; User: C_ntua

Search: Search took 0.01 seconds.

  1. Replies
    91
    Views
    18,237

    Correct :) In a for loop i++ and ++i are exactly...

    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
  2. Replies
    91
    Views
    18,237

    If I understand correctly you want something like...

    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...
Results 1 to 2 of 2