What's the proper use of printf to display pointers padded with 0s

后端 未结 9 2126
暖寄归人
暖寄归人 2021-01-31 14:32

In C, I\'d like to use printf to display pointers, and so that they line up properly, I\'d like to pad them with 0s.

My guess was that the proper way to do this was:

9条回答
  •  情深已故
    2021-01-31 15:11

    Note that if the pointer prints with the "0x" prefix, you would need to substitute "%018p" to compensate.

提交回复
热议问题