create a bitset of 1024 bits,

C++
std::bitset<1024 * 1024> my_bitset;

Source

Also in C++: