[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.6 SDLNet_Write32

void SDLNet_Write32(Uint32 value, void *area)

The 32bit number to put into the area buffer
The pointer into a data buffer, at which to put the number

Put the 32bit (a long on 32bit systems) value into the data buffer area in network byte order. This helps avoid byte order differences between two systems that are talking over the network. The value can be a signed number, the unsigned parameter type doesn't affect the data. The area pointer need not be at the beginning of a buffer, but must have at least 4 bytes of space left, including the byte currently pointed at.

// put my number into a data buffer to prepare for sending to a remote host
char data[1024];
Uint32 number=0xDEADBEEF;

See Also:
3.1.8 SDLNet_Read32, 3.1.5 SDLNet_Write16

This document was generated on November, 3 2009 using texi2html