title: C++: Converting Hexadecimal to Decimal
body: <p>I'm looking for a way to convert <code>hex</code><sup>(hexadecimal)</sup> to <code>dec</code><sup>(decimal)</sup> easily. I found an easy way to do this like :</p>
  
  <pre><code>int k = 0x265;
  cout &lt;&lt; k &lt;&lt; endl;
  </code></pre>
  
  <p>But with that I can't input <code>265</code>. Is there anyway for it to work like that:</p>
  
  <p>Input:  <code>265</code></p>
  
  <p>Output:  <code>613</code></p>
  
  <p>Is there anyway to do that ?</p>
  
  <p><strong>Note:</strong> I've tried: </p>
  
  <pre><code>int k = 0x, b;
  cin &gt;&gt; b;
  cout &lt;&lt; k + b &lt;&lt; endl;
  </code></pre>
  
  <p>and it doesn't work.</p>