zoukankan      html  css  js  c++  java
  • ANSI C 常见宏的使用

    1. __VA_ARGS__: ...  表示可变参数列表,__VA_ARGS__在预处理中会被可变参数列表替代

    2. __FILE__:正在编译文件的文件路径

    3. __LINE__:正在编译文件的行号

    4. __DATE__:编译时刻的日期字符串

    5. __TIME__:编译时刻的时间字符串

    6. __STDC__:判断该文件是不是标准C程序

     1 #include "stdafx.h"
     2 #include "stdio.h"
     3 
     4 #define LOG_TYPE(...)  
     5     printf(" Parameter[%s]
     File[%s]
     Line[%d]
     Function[%s]
     Date[%s]
     Time[%s]", 
     6   __VA_ARGS__, __FILE__, __LINE__, __FUNCTION__, __DATE__, __TIME__);
     7 
     8 int _tmain(int argc, _TCHAR* argv[])
     9 {
    10     
    11 #ifdef __STDC__
    12     LOG_TYPE("Standard C Program !");
    13 #else
    14     LOG_TYPE("Non-standard C Program !");
    15 #endif
    16 
    17     getchar();
    18     return 0;
    19 }

    运行结果:

  • 相关阅读:
    python 爬虫 urllib模块 url编码处理
    python 爬虫 urllib模块 目录
    python 爬虫 urllib模块介绍
    python 爬虫 目录
    爬虫 介绍
    POJ 2533
    POJ 2531
    POJ 2524
    POJ 2505
    POJ 2521
  • 原文地址:https://www.cnblogs.com/tyche116/p/9184009.html
Copyright © 2011-2022 走看看