Bro*_*olf 7 c++ compiler-construction datetime visual-studio
如何为构建目的打印日期和时间.即:当我的应用程序的控制台启动时,我想这样做:
Run Code Online (Sandbox Code Playgroud)Binary Build date: 03/03/2009 @ 10:00AM
我认为这对于所有应用程序来说都是一个非常有用的功能,可以为程序员提供支持,特别是在团队环境中.
在C++中使用Visual Studio 2008是否有一种简单的方法可以做到这一点.谢谢.
Vir*_*rne 12
使用预处理器__DATE__
和__TIME__
.
printf("Binary build date: %s @ %s\n", __DATE__, __TIME__);
Run Code Online (Sandbox Code Playgroud)
为了确保包含此代码的cpp文件是真正编译的,我使用touch-utility作为预构建步骤:touch file.cpp
Touch.bat:
@copy nul: /b +%1 tmp.$$$
@move tmp.$$$ %1
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
11854 次 |
最近记录: |