gpt4 book ai didi

c - ANSI C : standard definition for the size of the __DATE__ and __TIME__ strings?

转载 作者:太空宇宙 更新时间:2023-11-04 01:32:00 25 4
gpt4 key购买 nike

ANSI C 中 __DATE__ 和 __TIME__ 字符串的大小是否有标准定义?

这个问题背后的动机是:

  • 我有两个应用程序在两个不同的 CPU 上运行。

  • 在运行时,应用 #1 从应用 #2 接收日期和时间(作为版本信息的一部分)。

  • 当然,应用程序 #2 从预处理器 __DATE__ 和 __TIME__ 定义中获取它们。

所以我想知道我是否可以在应用程序 #1 中静态分配一个数组,我可以将从应用程序 #2 接收到的信息复制到该数组中。

谢谢

最佳答案

__DATE__

The date of translation of the source file (a character string literal of the form "Mmm dd yyyy", where the names of the months are the same as those generated by the asctime function, and the first character of dd is a space character if the value is less than 10). If the date of translation is not available, an implementation-defined valid date shall be supplied.

__TIME__

The time of translation of the source file (a character string literal of the form "hh:mm:ss" as in the time generated by the asctime function). If the time of translation is not available, an implementation-defined valid time shall be supplied.

关于c - ANSI C : standard definition for the size of the __DATE__ and __TIME__ strings?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20923970/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com