I have a long list of numbers between 0 and 67600. Now I want to store them using an array that is 67600 elements long. An element is set to 1 if a number was in the set and it
There is in fact! std::vector has a specialization for this: http://en.cppreference.com/w/cpp/container/vector_bool
std::vector
See the doc, it stores it as efficiently as possible.
Edit: as somebody else said, std::bitset is also available: http://en.cppreference.com/w/cpp/utility/bitset
std::bitset