How do I print "unsigned long"?

Asked 2 years ago, Updated 2 years ago, 126 views

I know how to output the int, long, float, and double types in C I don't know how to print unsigned long

printf("%lu\n", unsigned_boo)
printf("%du\n", unsigned_boo)
printf("%ud\n", unsigned_boo)
printf("%ll\n", unsigned_boo)
printf("%ld\n", unsigned_boo)
printf("%dl\n", unsigned_boo)

I tried all of the above, but all of them came out, so I was panickedㅜㅜ Can't you print unsigned long?

c printf long-integer unsigned

2022-09-22 13:58

1 Answers

It is correct to write %lu. Judging from what I wrote on the first line of the code, it should be printed correctly.

Do you initialize unsigned_bu and write it? Or there seems to be a memory contamination or other problem.


2022-09-22 13:58

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.