问题描述
我正在查看类似的代码行:
I'm looking at a code line similar to:
sprintf(buffer,"%02d:%02d:%02d",hour,minute,second);
我认为符号字符串是指每小时,分钟等显示的数字字符数 - 或者其他像那样,我不完全确定。
I think the symbolic strings refer to the number of numeric characters displayed per hour, minute etc - or something like that, I am not entirely certain.
通常情况下,我可以解决这类问题,但我一直无法在谷歌上找到任何有用的参考搜索%02d%01d。有人能为我解释一下吗?
Normally I can figure this sort of thing out but I have been unable to find any useful reference searching "%02d %01d" on google. Anyone able to shed some light on this for me?
推荐答案
相同的规则应该适用于Java。
the same rules should apply to Java.
在你的情况下它意味着输出2位或更多位的整数值,如果数字小于或者,则第一个为零等于9
in your case it means output of integer values in 2 or more digits, the first being zero if number less than or equal to 9
这篇关于这些符号字符串是什么意思:%02d%01d?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!