eratosthenis sieve in c++

C++
void eratosthenes_sieve(int N){
	bool primes[N+1];
  	memset(primes, true, sizeof(primes));
  	primes[0] = false;
  	primes[1] = false;
  	for (int p=2; p*p<=N; p++){
      	if (primes[p]){
          	for (int i=p*2; i<=N; i+=p)
              	primes[p] = false;
        }
    }
}
Source

Also in C++: