title: How to convert int to string (in c++) without access to int to string function
body: <p>So I got asked this on a skills test for an internship, and at the time it completely baffled me. I have some code now that I thought should work, but isn't assigning the correct values to the string.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  int main()
  {
       // declarations
       int i = 0, num= 63;
       string b="";
  
       while (num != 0)
       {
            i = num % 10;
            b.insert(0,i + 48 + "");
            num = num/10;
       }
  
  
       cout &lt;&lt; b &lt;&lt; endl;
  
       return 0;
  }
  </code></pre>
  
  <p>With "num" being the integer value (I just used 63 as an example)</p>
  
  <p>EDIT:: I incorrectly paraphrased, I could not use any function that did an int to string conversion for me, not that I couldn't use the string library, my mistake. </p>