Object-oriented approach to sieve of Eratosthenes
Is "n" really a good idea?

I don't like arr[i].getn().  The whole algorithm relies on the fact that arr[i].getn() is exactly i+1.  If this is ever not true, then the sieve will not work.  Given that the array index is inextricably linked to the value of n, I wouldn't even bother with n at all.

Using constant expressions in loop conditions

In two places, you use constant expressions in your loop condition:

for (i = 1; i &lt; sqrt(n); ++i) // sqrt() on every loop
for (unsigned j = 1; j &lt; ( n / (arr[i].getn()) ); ++j) // division on every loop


What's bad about this is that you will be calling sqrt() or doing a division on every loop, even though the value of the expression will never change.  It's possible the compiler could optimize this for you, but it's not a certainty.  It's easy enough to just move the expression out of the loop yourself:

int sqrtN = sqrt(n);
for (i = 1; i &lt; sqrtN; ++i)


Simplifying the loop

Even after getting rid of getn(), the second loop can still be simplified.  The current loop is this:

for (unsigned j = 1; j &lt; (n / (i+1)); ++j) {
    arr[i + j * (i+1)].setflagged(true);
}


It can be simplified to this:

for (unsigned j = i+(i+1); j &lt; n; j += (i+1)) {
    arr[j].setflagged(true);
}


In other words, instead of computing the array index using a multiplication, you can just have j be the array index.  This way avoids any multiplications and divisions and in my opinion is also simpler to read.  It would be even simpler if arr[i] stood for the number i instead of i+1.