PRINTF doesn't print leading zeroes

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

PRINTF doesn't print leading zeroes

754 次查看
michaelellis
Contributor II

SDK v.2.0 for TWR-KV58F220M

 

The PRINTF function does not seem to print leading zeroes.  For example:

 

PRINTF("0x%08X\n\r", 0xabcdef42U);
PRINTF("0x%08X\n\r", 0xabcdefU);

 

generates an output of:

 

0xABCDEF42
0x  ABCDEF

标签 (1)
0 项奖励
回复
3 回复数

608 次查看
michaelellis
Contributor II

Why is this normal behavior?  To my understanding, printf() should print leading zeroes when using the %08X format.

0 项奖励
回复

608 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Michael,

I think the Printf() function  omits the leading zero, this is a normal behaviour.

Sorry for not helping you.

BR

XiangJun Rong

0 项奖励
回复

608 次查看
michaelellis
Contributor II

Why is this normal behavior?  To my understanding, printf() should print leading zeroes when using the %08X format.

Michael

0 项奖励
回复