Loading, please wait...

Symbolic Constants

Standard C provides predefined symbolic constants, several of which are shown in the table. The identifiers for each of the predefined symbolic constants begin and end with two underscores.

 

These identifiers and the defined identifier cannot be used in #define or #undef directives.

 

Symbolic constants

Explanation

__LINE__

The line number of the current source code line (an integer constant).

__FILE__

The presumed name of the source file (a string).

__DATE__

The date the source file was compiled (a string of the form "Mmm dd yyyy" such as "Jan 28 1990").

__TIME__

The time the source file was compiled (a string literal of the form

"hh:mm:ss").

__STDC__

The value 1 if the compiler supports Standard C.