Store hex value as string (Arduino project)
<p>I'm working on an Arduino project and I want to store a hex value as string.</p>

<p>eg: Hex is C697C63B</p>

<pre><code>for (byte i = 0; i &lt; bufferSize; i++) {
     Serial.print(buffer[i], HEX);
}
</code></pre>

<p>I would like to store the String as <code>x = "C697C63B";</code></p>

<pre><code>  String CardID = "";
  for (byte i = 0; i &lt; bufferSize; i++) {
    CardID += (buffer[i],HEX);
    Serial.println(CardID);
  }
</code></pre>

<p>But the Sting is stored as <code>CardID = 16161616</code></p>

<p>Sorry I just start C++ for a week and I spend 3 day already just to find answer.</p>

<p>Okay i found the answer now thank you everyone that help</p>

<pre><code>  String CardID = "";
  for (byte i = 0; i &lt; bufferSize; i++)
    CardID += String(buffer[i], HEX);
  Serial.print(CardID);
</code></pre>