这些符号字符串是什么意思:%02d%01d? [英] what do these symbolic strings mean: %02d %01d?

查看:360
本文介绍了这些符号字符串是什么意思:%02d%01d?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看类似的代码行:

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?

推荐答案

http://www.cplusplus.com/reference/clibrary/cstdio/printf/

相同的规则应该适用于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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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