What is the quickest way to translate char* to number?
<p>What is the quickest way to translate char* to number ? I need to convert 4 chars to int, or two chars to short int. 
I tried like</p>

<pre><code>char* ar;
//fill ar with values  
int x= ar[1]+1[2]&lt;&lt;8+ar[3]&lt;&lt;16+ar[4]&lt;&lt;24; // ar[0] number of chars for number (short 2, int 4)
</code></pre>

<p>but result is always zero.( to explain I convert numbers to char* and than send over network, on another side I am trying to reverse process).</p>
