conver long long number to a char array in c
<p>I have two long long numbers a and b with 8-byte each. I also have a 16-byte array arr. I want to fit the first 8-byte of the array with a, and the last 8-byte of the array with b.</p>

<p>I'd like to do something like this:</p>

<pre><code>#include &lt;stdio.h&gt;

int main() {
    long long a = 123456;
    long long b = 654321;
    unsigned char arr[16];

    memcpy(arr, a, 8);
    memcpy(arr + 8, b, 8);

    return 0;
}
</code></pre>

<p>The compiler tells me that </p>

<blockquote>
  <p>incompatible integer to pointer conversion passing 'long long'
        to parameter of type 'const void *' [-Wint-conversion]</p>
</blockquote>

<p>My question is how to convert the long long to bytes that can fit into my array?</p>