Putting Hex into a byte array
<p>I am trying to put hex values into a <code>Byte[]</code>, Trying to achieve 78,66,1E,B5,4F,E7,67,63</p>

<pre><code>   #define BYTE   unsigned char
   int num = 1;

   long long hex[]
   {
     0x78661EB54FE76763,
   };

 int main()
 {

        for (int c = 0; c &lt; num; c++)
        {
            printf("%llx\n", hex[c]);

            unsigned int number = hex[c];
            unsigned int ef = number &amp; 0xff;
            unsigned int cd = (number &gt;&gt; 8) &amp; 0xff;
            unsigned int ab = (number &gt;&gt; 16) &amp; 0xff;

            printf("%x", number &amp; 0xff);

            BYTE data2[8]{
                ef, cd, ab
            };

        }
}
</code></pre>

<p><strong>Update:</strong></p>

<p>Basically I have an array of 30 odd hex values. I am trying to loop through that array called hex[], then for each hex value separate it into 2's ie 78,66,1E,B5,4F,E7,67,63 then add each one into an array of type BYTE which will hold the hex value in 8 pairs so data[0] will have the value of 78 up to data[8] which will have the value of 63, So I can then pass the array of type BYTE to another method for further work</p>