c++ bitset questions
<p>I want to ask two C++ bitset questions.</p>

<p>(1) How to create a bitset with a specified length from a function argument? I mean, for example, I have a function </p>

<pre><code>void f(int n)
</code></pre>

<p>And inside <code>f</code>, I need to create <code>bitset&lt;n&gt; bs;</code> Is this something doable?</p>

<p>(2) How to copy part of a bitset <code>bs</code> to form a new bitset? For example, given <code>starting index i1</code> and <code>ending index i2</code> where <code>i1</code>>=<code>i2</code>, I need to form a new bitset by copying those bits in <code>bs</code> from the least <code>i2</code>th significant bit exclusive to the least <code>i1</code>th significant bit inclusive (just to conform with <code>STL</code> convention).</p>

<p>Thank you.</p>
