Casting a char array to an integer
<p>Basically I am reading a binary format where 4 bytes specify the size of the string to follow. So i want to cast 4 chars I am reading from a buffer to 1 integer.</p>

<p>Here is what I have.</p>

<pre><code>int FileReader::getObjectSizeForMarker(int cursor, int eof, char * buffer) {
  //skip the marker and read next 4 byes
  int cursor = cursor + 4; //skip marker and read 4
  char tmpbuffer[4] = {buffer[cursor], buffer[cursor+1], buffer[cursor+2], buffer[cursor+3]};
  int32_t objSize = tmpbuffer;
  return objSize;

}
</code></pre>

<p>thoughts?</p>
