I'm trying to implement the Sieve of Erasthones in C++, and I've run into lots of problems. My code is as follows:

```
#include <iostream>
int main()
{
    const int max = 1000;
    int count = 1;
    bool arr[max];

    for(int i = 0; i < max; ++i)
        arr[i] = true;

    for(int i = 2; i < max; i++)
    {
        //mark all multiples
        for(int j = 2; (j*i) < max-1; ++j) arr[i*j] = false;
    }
}

```

I don't know what the next step is. I've looked online but I don't understand a lot of the code. Can you please provide an example of working c++ code and how it works?