C ++ fomat说明符相关问题 [英] c++ fomat specifier related question
本文介绍了C ++ fomat说明符相关问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
sprintf(dataStr, "%.2lX", (int) m_configObj->m_EncoderList[j].m_video.Contrast);
我想了解此程序中的%.2lx.
I want to know about %.2lx in this program.
推荐答案
请参阅以下链接:
See this Link : http://www.cplusplus.com/reference/clibrary/cstdio/sprintf/
Format for sprintf
%[flags][width][.precision][length]specifier
现在
%.2lx-%->标记之前的格式
-> .2-precision:指定要写入的最小位数.
-> l-长度:long int或unsigned long int
-> x-说明符:无符号十六进制整数
now
%.2lx - % -> as format before flags
-> .2 - precision : specifies the minimum number of digits to be written.
-> l - Length : long int or unsigned long int
-> x - specifier : Unsigned hexadecimal integer
这篇关于C ++ fomat说明符相关问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文