title: Printing char buffer in hex array
body: <p>I am reading 512 chars into a buffer and would like to display them in hex. I tried the following approach, but it just outputs the same value all the time, despite different values should be received over the network.</p>
  
  <pre><code>char buffer[512];
  bzero(buffer, 512);
  n = read(connection_fd,buffer,511);
  if (n &lt; 0) printf("ERROR reading from socket");
  printf("Here is the message(%d): %x\n\n", sizeof(buffer), buffer);
  </code></pre>
  
  <p>Is it possible that here I am outputting the address of the buffer array, rather than its content? Is there an easy way in C for this task or do I need to write my own subroutine?</p>