0

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.

3
Contributors
3
Replies
10
Views
6 Years
Discussion Span
Last Post by Ancient Dragon
0

Thanks, Salem. In languages such as C# there exists a separate decimal type, and int is not a decimal. That's why I thought that something similar might be in C.

Have a great week!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.