[Shootout-list] nsieve g++ c++

Falk Hueffner falk@debian.org
Sat, 19 Mar 2005 20:27:53 +0100


Daniel Skiles <dskiles@gmail.com> writes:

> Hey all,
> Here is the nsieve g++ c++ test, written with dev c++ on win32.  Let
> me know if there's anything wrong with it.

[...]

>     flags = new bool[m];
>     cout << "Primes up to " << m << " " << nsieve(m, flags) << endl;
>     delete flags;

Memory allocated by new[] is not zeroed. Also, you need delete[] to
free it.

-- 
	Falk