title: how to get hexdump of a structure data
body: <pre><code> ....
   finalize(char *hdrs, sendip_data *headers[], int index,
                      sendip_data *data, sendip_data *pack)
   {
  
   ........
  </code></pre>
  
  <p>For debugging purposes I want a hex dump of the <code>data</code> and <code>pack</code> structures, which are of type <code>sendip_data</code>, a really complex structure. Actually they contain some binary information so I am not sure whether output of my project is correct or not. So for debugging purposes, I want to write the data into a file so that I can use hexdump as follows -</p>
  
  <pre><code>$hexdump -C file.txt
  </code></pre>
  
  <p>Also as this is a run time generation of a n/w packet so I am also not sure about the length of <code>data</code> and <code>pack</code> structure which I think <code>fread / fwrite</code> will require ..So please suggest me something.</p>