1. 程序运行时候最好先打印编译时间
1 /************************************************* 2 Author:xx 3 Date: 4 Description: 程序运行时先打印编译时间 5 **************************************************/ 6 7 #include <stdio.h> 8 9 /*打印编译时间*/ 10 void PrintCompilingTime() 11 { 12 printf("|------------------------------------------|\n"); 13 printf("|Program Release Date : %s\n",__DATE__); //编译时的日期,用“MM dd yyyy”形式的字符串常量表示 14 printf("|Program Release Time : %s\n",__TIME__); //编译时的时间,用“hh:mm:ss”形式的字符串常量表示 15 printf("|------------------------------------------|\n"); 16 } 17 18 /*打印其他宏定义*/ 19 void PrintOtherPrededinedMacros() 20 { 21 printf("Programmer Release Date : %d\n",__LINE__); //当前源程序行的行号,用十进制整数常量表示 22 printf("Programmer Release Date : %s\n",__FILE__); //当前源文件的名称,用字符串常量表示 23 } 24 25 int main() 26 { 27 PrintCompilingTime(); 28 PrintOtherPrededinedMacros(); 29 return 0; 30 }
标签:__,输出,常量,Release,编译,时间,printf,Date From: https://www.cnblogs.com/dkhlaojogo/p/16889964.html