Generate all ways of selection of n items
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/679203/how-to-find-all-possible-subsets-of-a-given-array">How to find all possible subsets of a given array?</a>  </p>
</blockquote>



<p>How can all ways of selection of items be generated efficiently using C++?</p>

<p>For example, if there are there items A, B and C.</p>

<pre><code>[A,B,C] =&gt; [A], [B], [C], [A,B], [B,C], [A,C], [A, B, C]
</code></pre>
