TutGetIntFormat


Name

TutGetIntFormat — get the integer number format of this computer

Synopsis

T_INT_FORMAT TutGetIntFormat() 

Arguments

None

Return Values

T_INT_BIG_ENDIAN or T_INT_LITTLE_ENDIAN.

Diagnostics

None

Description

TutGetIntFormat returns the format of integers on the current computer. Integers are either big-endian (the most significant byte is stored in the highest byte) or little-endian (the most significant byte is stored in the lowest byte). Software that transfers data between computers with different number formats, such as between a SPARC and VAX machines, needs to know the format of integers and real numbers to convert the data from one format to another.

Caution

None

See Also

TutGetRealFormat

Examples

This example prints the byte order of integers:

if (TutGetIntFormat() == T_INT_BIG_ENDIAN) { 
  TutOut("Integers are big-endian.\n"); 
}  
else { 
  TutOut("Integers are little-endian.\n"); 
}  

TIBCO SmartSockets™ Utilities
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com