When working with Project Euler problems I often need large (> 10**7) bit array\'s.
My normal approach is one of:
bool* sieve = new bool[N]; bool sieve[
You can use a byte array and index into that. Index n would be in byte index n/8, bit # n%8. (In case std::bitset is not available for some reason).
n
n/8
n%8