The table below lists the symbols that the ANSI C standard requires.
ANSI predefined symbols:|
This macro
|
is
|
|---|---|
Listing 7.1 shows a small program that uses the ANSI predefined symbols.
Using ANSI's Predefined Symbols:#include <stdio.h>
void main(void)
{
printf("Hello World!\n");
printf("%s, %s\n", __DATE__, __TIME__);
printf("%s, line: %d\n", __FILE__, __LINE__);
}The program prints something like the following:
Hello World! Oct 31 1995, 18:23:50 main.ANSI.c, line: 10