When printing an int to stdout, the %d type is used. Why "d"? The other types (s for string, c for char, f for float) all make mnemonic sense, but I cannot figure out why "d" for int. It's not short for "double" or "decimal" I think.
dotancohen
0
Junior Poster in Training
Recommended Answers
Jump to Post%d = decimal
%o = octal
%x = hex
Seemed as plausible as anything to me.
All 3 Replies
Salem
5,138
Posting Sage
dotancohen
commented:
Thank you!
+2
dotancohen
0
Junior Poster in Training
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.