title: Convert binary string to integer string c++
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/117844/converting-string-of-1s-and-0s-into-binary-value">Converting string of 1s and 0s into binary value</a>  </p>
  </blockquote>
  
  
  
  <p>I would like to convert a binary string to an integer string in c++. e.g:</p>
  
  <p><code>"000000000010"</code> becomes <code>"2"</code></p>
  
  <p>I have the following constraint: i can not convert this string to an integer type and then convert it again to string because that binary string can be very huge!</p>
  
  <p>I already tried to do it with <code>stringstream</code>, inserting the binary string to it with the flag <code>std::stringstream::binary</code> and then output the content using the <code>std::dec</code> flag, but it doesn't work</p>
  
  <p>Thank you all in advance.</p>