Predefined Macro Names

C/C++ specifies several built-in predefined macro names. They are

 _ _LINE_ _ _ _FILE_ _ _ _DATE_ _ _ _STDC_ _ _ _TIME_ _ _ _cplusplus 

The _ _LINE_ _ and _ _FILE_ _ macros are described in the #line discussion. The others will be examined here.

The _ _DATE_ _ macro is a string, in the form month/day/year, that is the date of the translation of the source file into object code.

The time of the translation of the source code into object code is contained as a string in _ _TIME_ _. The form of the string is hour:minute:second.

The macro _ _cplusplus is defined when compiling a C++ program. This macro will not be defined by a C compiler. The macro _ _STDC_ _ is defined by a C program and may be defined by a C++ compiler. In both cases, check your compiler’s documentation for details.

Most C/C++ compilers define several other built-in macros that relate to the specific environment and implementation.

Additional Built-In Macros Defined by C99

C99 adds the following macros to those just described. They are not supported by C++.


1 if an operating system is present


199901L or greater; represents version of C

_ _STDC_IEC_559_ _

1 if IEC 60559 floating-point arithmetic is supported


1 if IEC 60559 complex arithmetic is supported

_ _STDC_ISO_10646_ _

A value of the form yyyymmL that states the year and month of the ISO/IEC 10646 specification supported by the compiler

C(s)C++ Programmer's Reference
C Programming on the IBM PC (C Programmers Reference Guide Series)
ISBN: 0673462897
EAN: 2147483647
Year: 2002
Pages: 539 © 2008-2017.
If you may any questions please contact us: