ANSI C:标准清晰度的__DATE__和__TIME__字符串的大小? [英] ANSI C: standard definition for the size of the __DATE__ and __TIME__ strings?

查看:186
本文介绍了ANSI C:标准清晰度的__DATE__和__TIME__字符串的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有为__DATE__和__TIME__字符串的ANSI C?

Is there a standard definition for the size of the __DATE__ and __TIME__ strings in ANSI C?

这背后的问题的动机是:

The motivation behind this question is:


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

  • I have two applications running on two different CPUs.

在运行时,应用程序#1从应用程序2#接收日期和时间(如的版本信息部分)。

During runtime, app #1 receives date and time (as part of version-info) from app #2.

当然,应用#2从preprocessor ​​__DATE__和__TIME__的定义需要他们。

Of course, app #2 takes them from the preprocessor __DATE__ and __TIME__ definitions.

所以,我想知道是否我可以在app#1的阵列,在其中我可以复制从应用程序#2接收到的信息静态分配。

So I would like to know whether or not I can statically allocate in app #1 an array, into which I can copy the info received from app #2.

感谢

推荐答案

__ __ DATE

__DATE__

源文件的翻译的日期(字符串
  文字形式嗯DD YYYY,这里的月份的名称
  是一样由asctime函数生成的,并且
  的dd第一字符是空格字符,如果值小于
  比10)。如果转换的日期不可用,一个
  实现定义的有效日期应提供。

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

__TIME__

源文件的翻译的时间(一个字符串
  文字的形式为HH:MM:SS作为由生成的时间
  asctime功能)。如果翻译的时间不可用,
  实现定义的有效时间应提供。

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.

这篇关于ANSI C:标准清晰度的__DATE__和__TIME__字符串的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆