有用的C 预定义的宏:__DATE__,__TIME__,__FILE__,__LINE__

U_BOOT_VERSION:1.2.3 (May 7 2024 - 21:58:35)

Date : May 7 2024

Time : 21:58:35

File : test.c

Line : 13

#include <stdio.h>

#define U_BOOT_VERSION "1.2.3"

const char version_string[] =

U_BOOT_VERSION" (" DATE " - " TIME ")";

int main()

{

printf("U_BOOT_VERSION:%s \n",version_string);

printf("Date : %s\n", DATE);

printf("Time : %s\n", TIME);

printf("File : %s\n", FILE);

printf("Line : %d\n", LINE);

return 0;

}

相关推荐
大柏怎么被偷了1 小时前
【Linux】动静态库
linux
草莓熊Lotso1 小时前
Linux 实战:从零实现动态进度条(含缓冲区原理与多版本优化)
linux·运维·服务器·c++·人工智能·centos·进度条
练习时长一年2 小时前
Leetcode热题100(跳跃游戏 II)
算法·leetcode·游戏
小白菜又菜7 小时前
Leetcode 3432. Count Partitions with Even Sum Difference
算法·leetcode
程途拾光1588 小时前
企业部门协作泳道图制作工具 PC端
大数据·运维·流程图
wuhen_n8 小时前
LeetCode -- 15. 三数之和(中等)
前端·javascript·算法·leetcode
sin_hielo9 小时前
leetcode 2483
数据结构·算法·leetcode
dishugj9 小时前
【linux】Redhat 6.3系统安装zabbix-agent软件包,无法使用YUM源问题
linux·运维·zabbix
无奈笑天下9 小时前
【麒麟镜像vmtools异常排查指导书】
linux·运维·经验分享·云计算·kylin
dajun1811234569 小时前
PC端中文免费在线跨职能泳道图制作工具
运维·架构·流程图·敏捷流程·交通物流