c语言预定义标识符Stdc,C语言几种 预定义宏

c的几种可供C语言使用的预定义宏

MSDN 上的解释

__DATE__

The compilation date of the current source file. The date is a

string literal of the form Mmm dd yyyy. The month name Mmm is the

same as for dates generated by the library function asctime

declared in TIME.H.

__FILE__

The name of the current source file. __FILE__ expands to a string

surrounded by double quotation marks. To ensure that the full path

to the file is displayed, use /FC (Full Path of Source Code File in

Diagnostics).

You can create your own wide string version of __FILE__ as

follows:

Copy Code

#include

#define WIDEN2(x) L ## x

#define WIDEN(x) WIDEN2(x)

#define __WFILE__ WIDEN(__FILE__)

wchar_t *pwsz = __WFILE__;

int main() {}

__LINE__

The line number in the current source file. The line number is a

decimal integer constant. It can be altered with a #line

directive.

__STDC__

Indicates full conformance with the ANSI C standard. Defined as the

integer constant 1 only if the /Za compiler option is given and you

are not compiling C++ code; otherwise is undefined.

__TIME__

The most recent compilation time of the current source file. The

time is a string literal of the form hh:mm:ss.

__TIMESTAMP__

The date and time of the last modification of the current source

file, expressed as a string literal in the form Ddd Mmm Date

hh:mm:ss yyyy, where Ddd is the abbreviated day of the week and

Date is an integer from 1 to 31.

以下是晚上找到的解释

__LINE__ 在源代码中插入当前源代码行号

__FILE__ 在源代码中插入当前源代码文件名

__DATE__ 在源代码中插入当前编译日期〔注意和当前系统日期区别开来〕

__TIME__ 在源代码中插入当前编译时间〔注意和当前系统时间区别开来〕

__STDC__ 当要求程序严格遵循ANSIC标准时该标识符被赋值为1。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
C语言的"bits/stdc++.h"是一个常见的头文件包含语句,通常用于竞赛编程等需要使用到多个标准库函数和数据结构的情况。然而,这个头文件并不是C语言标准库的一部分,因此在标准C编译器可能无法直接使用。 该头文件的实际内容取决于具体的编译环境和配置。在某些环境,它被用作一个万能头文件,包含了许多常用的标准库头文件,例如<cstdio>、<iostream>、<vector>等等。这样一来,在使用这个头文件后,就不再需要单独包含各个标准库头文件了,可以节省编写代码的时间和精力。但需要注意的是,这种使用方式可能会导致编译时间增长和代码可读性下降。 然而,在标准的C编译器,并没有名为"bits/stdc++.h"的头文件。如果您想使用该头文件,可以尝试查找是否有与之类似的头文件或者根据您的编译环境自行编写一个包含需要的标准库头文件的头文件。<span class="em">1</span><span class="em">2</span> #### 引用[.reference_title] - *1* [C++<bits/stdc++.h>说明](https://blog.csdn.net/cnd2449294059/article/details/72871240)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [万能头文件#include&amp;lt;bits/stdc++.h&amp;gt; using namespace std;](https://download.csdn.net/download/weixin_62196200/85007632)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值