Example of __CODEGEARC_VERSION__ Macro

From RAD Studio
Jump to: navigation, search

Go Up to Predefined Macros


The following example illustrates the use of the __CODEGEARC_VERSION__ macro to print values similar to the ones displayed by BCC32.exe when the compiler is run with the --version option.

#include <iostream>
int main()
{
 std::cout << "Version: "
 << std::hex
 << ((__CODEGEARC_VERSION__ & 0xFF000000) >> 24) << '.'
 << ((__CODEGEARC_VERSION__ & 0x00FF0000) >> 16) << '.'
 << std::dec
 << ((__CODEGEARC_VERSION__ & 0x0000FFFF))
 << std::endl;
 return 0;
}

When run with the XE2 version of BCC32, the above program displays the following:

Version: 6.40.26555
Retrieved from "https://docwiki.embarcadero.com/RADStudio/Athens/e/index.php?title=Example_of_CODEGEARC_VERSION_Macro&oldid=178627"