title: How to convert a hexadecimal value represented by a char?
body: <p>I have an unsigned char array where I would like to parse its first four elements as HEX values.</p>
  
  <p>I receive and <code>unsiged char array a[]</code>,whose content is this</p>
  
  <pre><code>for (int i = 0; i &lt; l; i++) {
    SerialUSB.print(" Index : ");
    SerialUSB.print(i);
    SerialUSB.print(" ,Unsigned Char ");
    SerialUSB.print( a[i]);
    SerialUSB.print(", CHAR ");
    SerialUSB.print( (char) a[i]);
    SerialUSB.println();
  }
  
  Index:0  ,Unsigned Char 98, CHAR b
  Index:1  ,Unsigned Char 49, CHAR 1
  Index:2  ,Unsigned Char 53, CHAR 5
  Index:3  ,Unsigned Char 57, CHAR 9
  Index:4  ,Unsigned Char 55, CHAR 7
  Index:5  ,Unsigned Char 56, CHAR 8
  Index:6  ,Unsigned Char 85, CHAR U
  Index:7  ,Unsigned Char 55, CHAR 7
  Index:8  ,Unsigned Char 56, CHAR 8
  Index:9  ,Unsigned Char 85, CHAR U
  Index:10 ,Unsigned Char 55, CHAR 7
  Index:11 ,Unsigned Char 56, CHAR 8
  Index:12 ,Unsigned Char 85, CHAR U
  </code></pre>
  
  <p>How can I get the HEX value of the first four elements of array <code>a[]</code></p>
  
  <pre><code>inHex[0] = 0xB; // 0xB = 11
  inHex[1] = 0x15; // which should come from having concatenated the values `a[1]= '1'` algong with `a[2]='2'`
  inHex[3] = 0x9; // which should  be the char value of a[3] in HEX
  </code></pre>
  
  <p>Thanks in advance.</p>