serveral different ways to read unsigned char from file
<p>I want to read unsigned char from file and have search many different ways to execute. But I don't know the reason why they work or don't work.</p>

<p>1.
<code>ifstream input(ios::in | ios::binary) //seems to not work, but why?</code></p>

<p>I have set the <code>ios::binary</code> which supposed to prevent the convertion.</p>

<p>2.
<code>unsigned char buffer[BUFFER_SIZE];</code></p>

<p><code>myfile.read((unsigned char *) buffer, BUFFER_SIZE);//error!fail</code></p>

<p><code>myfile.read((char *) buffer, BUFFER_SIZE);//work, the data type is unsigned char</code></p>

<p>why do I have to convert it to <code>char*</code>?
The data stored in the array won't be converted to char not <code>unsigned char</code>?
What does it do during convertion?</p>

<p>3.
<code>vector</code>//it work but I don't know what it have done.
</p>

<p>Thx for you reading my lengthy question, thx you in advance.</p>
