搜尋此網誌

2013年1月3日 星期四

Predefined macro names - ANSI C


The following names shall be defined by the implementation:

__LINE__
The line number of the current source line (a decimal constant).
__FILE__
The presumed name of the source file (a character string literal).
__FUNCTION__
Valid only within a function and returns the undecorated name of the enclosing function (as a string). __FUNCTION__ is not expanded if you use the /EP or /P compiler option.
__DATE__ 
The date of translation of the source file (a character string literal of the form "Mmm dd yyyy", where the names of the months are the same as those generated by the asctime function, and the first character of dd is a space character if the value is less than 10). If the date of translation is not available, an implementation-defined valid date shall be supplied.
__TIME__
The time of translation of the source file (a character string literal of the form "hh:mm:ss" as in the time generated by the asctime function). If the time of translation is not available, an implementation-defined valid time shall be supplied.
__TIMESTAMP__
The date and time of the last modification of the current source file, expressed as a string literal in the form Ddd Mmm Date hh:mm:ss yyyy, where Ddd is the abbreviated day of the week and Date is an integer from 1 to 31.
__STDC__ 
The decimal constant 1, intended to indicate a conforming implementation.
The values of the predefined macros (except for __LINE__ , __FUNCTION__ and __FILE__) remain constant throughout the translation unit.

沒有留言:

張貼留言