title: Byte swapping a struct
body: <p>Okay I hate to ask this question ... but here goes. I am writing some code in C on an x86 machine. I want to send a struct over the network and and I want to convert the struct to Network Byte Order ... I understand all the drama about packing and the the gcc packing pragmas ... what I want to know is HOW do I convert a struct (or an array or any such arbitrary memory blob) to network byte order. </p>
  
  <p>Is there a standard (Unix/Linux/Posix) function call I can use or must I roll my own. </p>
  
  <p>x</p>