The ILE C/C++ compiler recognizes the following macros defined by the ANSI/ISO Standard. Unless otherwise specified, macros when defined have a value of 1.
"Mmm dd yyyy"
where:
"hh:mm:ss"
where:
Notes:
Examples
The following printf() statements will display the values of the predefined macros __LINE__, __FILE__, __TIME__, and __DATE__ and will print a message indicating the program's conformance to ANSI standards based on __STDC__:
#include <stdio.h>
#ifdef __STDC__
# define CONFORM "conforms"
#else
# define CONFORM "does not conform"
#endif
int main(void)
{
printf("Line %d of file %s has been executed\n", __LINE__, __FILE__);
printf("This file was compiled at %s on %s\n", __TIME__, __DATE__);
printf("This program %s to ANSI standards\n", CONFORM);
}
|
Related Information
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.