Programming in C: Unit I (d): Preprocessor Directives

Predefined Macro Names

with Example C Programs | Preprocessor Directives

There are certain predefined macros that are readily available for use by the C programmers. A list of such predefined macros is given in Table 10.2.

PREDEFINED MACRO NAMES

There are certain predefined macros that are readily available for use by the C programmers. A list of such predefined macros is given in Table 10.2.

#include <stdio.h>

void main(void)

{

printf("\n Current File's Path Name:%s", _FILE_ );

printf("\n Line Number in the current file: %d", _LINE_ );

printf("\n Date of Compilation: %s", _DATE_);

printf("\n Time of Compilation: %s", _TIME_);

#ifdef _STDC_

printf("\n Your C compiler conforms with the ANSI C standard");

#else

printf("\n You C compiler doesn't conform with the ANSI C standard");

#endif

}

Programming in C: Unit I (d): Preprocessor Directives : Tag: : with Example C Programs | Preprocessor Directives - Predefined Macro Names