title: Converting numbers to base 10 with C++
body: <p>This isn't returning any answer at all when I run it. I can't quite figure out why. Basically I need to multiply each digit of a given number by its base raised to the degree equal to the number of digits. the power decrements each time it runs. Or it should, anyway. It doesnt. </p>
  
  <pre><code>int num, sum, base;
  sum = 0;
  cout &lt;&lt; "num";
  cin &gt;&gt; num;
  cout &lt;&lt; "base";
  cin &gt;&gt; base;
  
  int power = 0;
  
  while (num &gt; 0)
  {
      power++;
      num = num/10;
  }
  return power;
  sum = 0 ;
  while (num &gt; 0);
  {
      sum = (num%10)*(pow(base, power));
      num = num/10;
      power--;
  
  
  }
  sum += sum;
  
  cout &lt;&lt; sum;
  </code></pre>