get_version


unsigned get_version()

This function obtains the version of the operating system.

Return

unsigned

The value returned contains the major and minor version numbers of the operating system in the low order 16 bits and information about the operating system platform in the high order 16 bits. For all platforms, the low order 16 bits contains the version number of the operating system. The low-order byte of this 16 bits specifies the major version number. The high-order byte specifies the minor version (revision) number.

To distinguish between operating system platforms, the high order bit and the low order byte, are shown in the following table:

Operating System High Order Bit Low Order byte
windows NT 0 Version 3, 4 or 5.
windows 95 & 98 1 Version 4
windows 2000 & XP 0 Version 5

For windows NT, the remaining bits in the high-order part contain the build number. For windows 95 and 98, the remaining bits in the high-order part are reserved.

Notes

The function get_version_extended obtains more detailed version information.