欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2022-06-22 15:21:32
1 /* 2 predef.c -- 预定义宏和预定义标识符 3 */ 4 5 #include 6 7 void why_me(void); 8 9 int main() 10 { 11 printf("The file is %s.\n", __FILE__); 12 pri ......
第 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

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