title: What does this line of C code mean?
body: <p>I'm converting some C code to Delphi. Can someone please explain to me what this line means?</p>
  
  <pre><code>nResult = ( (pBuffer[ 0 ] &lt;&lt; 8) &amp; 0xFF00 )
   | ( pBuffer[ 1 ] &amp; 0x00FF );
  </code></pre>
  
  <p>Here is the rest of the code for context:</p>
  
  <pre><code>USHORT UTIL_htons( USHORT hostshort )
  {
   PUCHAR pBuffer;
   USHORT nResult;
  
   nResult = 0;
   pBuffer = (PUCHAR )&amp;hostshort;
  
   nResult = ( (pBuffer[ 0 ] &lt;&lt; 8) &amp; 0xFF00 )
    | ( pBuffer[ 1 ] &amp; 0x00FF );
  
   return( nResult );
  }
  
  USHORT UTIL_ntohs( USHORT netshort )
  {
   return( UTIL_htons( netshort ) );
  }
  ULONG UTIL_htonl( ULONG hostlong )
  {
   PUCHAR pBuffer;
   ULONG nResult;
   UCHAR c, *pResult;
  
   pBuffer = (PUCHAR )&amp;hostlong;
  
   if( !pBuffer )
   {
    return( 0L );
   }
  
   pResult = (UCHAR * )&amp;nResult;
  
   c = ((UCHAR * )pBuffer)[ 0 ];
   ((UCHAR * )pResult)[ 0 ] = ((UCHAR * )pBuffer)[ 3 ];
   ((UCHAR * )pResult)[ 3 ] = c;
  
   c = ((UCHAR * )pBuffer)[ 1 ];
   ((UCHAR * )pResult)[ 1 ] = ((UCHAR * )pBuffer)[ 2 ];
   ((UCHAR * )pResult)[ 2 ] = c;
  
   return( nResult );
  }
  ULONG UTIL_ntohl( ULONG netlong )
  {
   return( UTIL_htonl( netlong ) );
  }
  </code></pre>
  
  <p>Thanks in advance
  Bojan</p>