title: Hexadecimal addition C++
body: <p>I need to write a program that reads in two hexadecimal numbers, converts them to decimal form, and prints out the sum of the two numbers in decimal. This is as far as I've gotten, I can't seem to get the right values to add up. </p>
  
  <pre><code> #include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  
  using namespace std;
  void Hex_to_Dec(char &amp;, char &amp;);
  int main()
  {
      char hex1;
      char hex2;
  
      cout &lt;&lt; " Please enter a hexadecimal number: " &lt;&lt; endl;
      cin &gt;&gt; hex1;
  
      cout &lt;&lt; " Please enter another hexadecimal value: " &lt;&lt; endl;
      cin &gt;&gt; hex2;
  
      Hex_to_Dec(hex1, hex2);
  
      cout &lt;&lt; "The decimal sum of" &lt;&lt; hex1 &lt;&lt; " and " &lt;&lt; hex2 &lt;&lt; " is " &lt;&lt; hex1 + hex2 &lt;&lt; endl;
  
      return 0;
  }
  
  void Hex_to_Dec(char &amp; hex1, char &amp; hex2)
  {
      std::cin &gt;&gt; std::hex &gt;&gt; hex1;
      std::cout &lt;&lt; hex1 &lt;&lt; std::endl;
  
      std::cin &gt;&gt; std::hex &gt;&gt; hex2;
      std::cout &lt;&lt; hex2 &lt;&lt; std::endl;
  }
  </code></pre>