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[
A 'bool' type isn't stored using only 1 bit. From your comment about the size, it seems to use 1 entire byte for each bool.
A C like way of doing this would be:
uint8_t sieve[N/8]; //array of N/8 bytes
and then logical OR bytes together to get all your bits:
sieve[0] = 0x01 | 0x02; //this would turn on the first two bits
In that example, 0x01 and 0x02 are hexadecimal numbers that represent bytes.