What's the best data type that can handle a sequence of digits [0:9] in c++ with the least possible waste in memory?
I think it may be something like that
typedef bitset<4> Digit;
vector<Digit> myVector;
but I think that each bitset<4>
reserves a byte -the same as a char-, so it's not better than a normal string, is it?
Are there any better idea to handle something like that?