[SDL] little endian and big endian

Brian brian.ripoff at gmail.com
Tue Apr 7 06:50:52 PDT 2009


Endian issues really only come into play when sharing data between
such systems, such as files or through a network. In such cases, one
of the endian formats is chosen arbitrarily (for example, big endian
is typically used over a network) and the application must be written
to perform the endian conversions. In C (and probably available from
other languages) there are routines such as htonl and ntohl ("host to
network long" and "network to host long" respectively) that make it
easier to do this.

Another important note is that type sizes can vary between different
machines. So you should also decide how many bits are used to
represent data in a file format or in a network protocol.

On Tue, Apr 7, 2009 at 2:28 PM, Francisco Bodego Franco
<fran at ikasplay.com> wrote:
> Hi everybody!!!
> I have one doubt about little endian and big endian issue.
> I want to develop one game for windows, linux and MacOS, can I use the int,
> bool, char and String literals normally? Or I have to create new classes
> that simulate this literals?
> Thanks for all,
> FRAN



More information about the SDL mailing list