dynamic bitset

i want to assign number of bits by a variable in bitset ? how to do that?
bitset<4> foo;
instead of 4 i want to use some variable and later on by user i want to assign it!
please don't suggest some boost library or any other library!
thank you!
The STL bitset is not dynamic. It is a compile-time constant size.

What you want to use instead is (alas) a vector<bool>.
Topic archived. No new replies allowed.