C++ Convert Large Number into Hexadecimal
<p>I got a large number of this value</p>

<pre><code>DECIMAL: 3712299789313814843
</code></pre>

<p>I want to convert it into hexadecimal using C++</p>

<p>I did an online conversion and I realized the </p>

<pre><code>hexadecimal value is     3384BCFD61CEB13B
</code></pre>

<p>I found some solution online and I try convert but it give me this:</p>

<pre><code>string hex_value(int decimal)
{
  static const string hex_digits("0123456789ABCDEF");

  string hex;
  int scratch = decimal;

  while (scratch != 0)
  {
    hex += hex_digits[scratch % 16];
    scratch /= 16;
  }

  reverse(hex.begin(), hex.end());

  return hex;
}

input= hex_value(atoi(buffer.c_str()));



HEXA: 61CEB13B
</code></pre>

<p>I think integer is too small to send in the data.. i do use NTL, namely ZZ class but i not sure how to use it in this case..</p>

<p>anyone can guide me on how to convert this large number into hexadecimal.. </p>

<p>Thanks!!</p>
