title: How to convert bytes stored inside a buffer to a variable?
body: <p>So I'm reading from a file descriptor which contains an <code>int</code> variable in its raw byte format. </p>
  
  <p>So I'm doing:</p>
  
  <pre><code>char buffer[sizeof(int)];
  ssize_t sizeOfFile = read(sock_fd, buffer, sizeof(int));
  
  int extractedInt = ???;
  </code></pre>
  
  <p>How can I convert that buffer to an integer? I was thinking of memcpy but was wondering if there are better ways. </p>