title: C - Adding the numbers in 2 strings together if a different length
body: <p>If I had two strings:</p>
  
  <pre><code>a = "1234"
  b = "4321"
  </code></pre>
  
  <p>I could add the two numbers together like this:</p>
  
  <pre><code>for(i=0; i&lt;width-1; i++){
      sum = (a[width-2-i]-48) + (b[width-2-i]-48) + carry;
      carry = 0;
      if(sum &gt; 9){
          carry = 1;
          sum-=10;
      }
      answer[i] = sum+48;
  }
  
  if(carry) answer[i++] = carry+48;
  answer[i]= 0;
  </code></pre>
  
  <p>And then reverse it (width is equal to strlen(a)).</p>
  
  <p>How could I do the same thing if the following?</p>
  
  <pre><code>a = "12345"
  b = "4321"
  </code></pre>
  
  <p>Would I need to reallocate memory? Or what?</p>
  
  <p>(BTW - <a href="http://projecteuler.net/problem=13" rel="nofollow">the problem I'm trying to solve</a> is using many numbers all with 50 digits, so strtoul or strtoull is out of the question as I understand. <a href="http://pastebin.com/RhxGKUGG" rel="nofollow">Here's my code so far</a>.)</p>