四个常用宏

四个常用宏:

__FILE__// 当前文件名

__DATE__// 编译日期

__LINE__// 编译行数

__TIME__// 编译时间

 

// liangxiaxu@126.com
#include <stdio.h>

int main(void)
{           
    printf("hello, gcc!\n");
    printf("%s\n", __FILE__);  
    printf("%s\n", __DATE__);
    printf("%d\n", __LINE__);
    printf("%s\n", __TIME__);
    return 0; 
}
// vim: set tabstop=4 shiftwidth=4 expandtab:

[hayuk@localhost qinghua]$ ./hello
hello, gcc!
hello.c
Nov  2 2012
9
07:56:26

posted @ 2012-11-03 10:15  liangxiaxu  阅读(335)  评论(0编辑  收藏  举报