第 16 章 C 预处理器和 C 库(预定义宏)

 1 /*-------------------------------------
 2     predef.c -- 预定义宏和预定义标识符
 3 -------------------------------------*/
 4 
 5 #include <stdio.h>
 6 
 7 void why_me(void);
 8 
 9 int main()
10 {
11     printf("The file is %s.\n", __FILE__);
12     printf("The data is %s.\n", __DATE__);
13     printf("The time is %s.\n", __TIME__);
14     //printf("The version is %ld.\n", __STDC__);
15     printf("This is line %d.\n", __LINE__);
16     printf("This function is %s\n", __FUNCTION__);
17     
18     why_me();
19 
20     return 0;
21 }
22 
23 void why_me()
24 {
25     printf("This function is %s\n", __FUNCTION__);
26     printf("This is line %d.\n", __LINE__);
27 }
predef.c

posted @ 2018-07-03 10:08  web1013  阅读(139)  评论(0编辑  收藏  举报