C++ unsigned char array length
<p>I have in my C++ program unsigned char array of hex values:</p>

<pre><code>unsigned char buff[] = {0x03, 0x35, 0x6B};
</code></pre>

<p>And I would like to calculate the size of this array so that I can send it on UART port linux using this function:</p>

<pre><code>if ((count = write(file,buff,length))&lt;0)
{
    perror("FAIL to write on exit\n"); 
}
</code></pre>

<p>as I can see the length is int number, and buff is an array which can change size during program execution.
can anyone help me how to write it. Thanks</p>