title: How do I convert an unsigned char array into a string in C?
body: <p>If I have an array such as this </p>
  
  <pre><code>unsigned char data[2850] = "";
  </code></pre>
  
  <p>that after running through a part of my program will eventually be full of byte elements such that if I loop through it and log it out I will see the following</p>
  
  <pre><code>    for (size_t i= 0; i &lt; sizeof(data); i++) {
          printf("%02X ", data[i]);
      }
  
      //log window shows 01 24 81 00 0E 1C 44 etc...
  </code></pre>
  
  <p>Is there a way to take all the elements of the data array and put them into a const char? Or just one large string? Hopefully I'm being clear enough. My goal is to eventually turn all the elements of this data array into a base64 encoded string that I can use else where in the program. </p>