How to printf “unsigned long” in C?

后端 未结 7 600
有刺的猬
有刺的猬 2020-11-28 01:08

I can never understand how to print unsigned long datatype in C.

Suppose unsigned_foo is an unsigned long, then I try:

7条回答
  •  情书的邮戳
    2020-11-28 01:18

    %lu is the correct format for unsigned long. Sounds like there are other issues at play here, such as memory corruption or an uninitialized variable. Perhaps show us a larger picture?

提交回复
热议问题