python小菜 2008-09-01 22:45 采纳率: 66.7%
浏览 256
已采纳

关于 printf 格式格式长的争论是什么?

The printf function takes an argument type, such as %d or %i for a signed int. However, I don't see anything for a long value.

转载于:https://stackoverflow.com/questions/38561/what-is-the-argument-for-printf-that-formats-a-long

  • 写回答

7条回答 默认 最新

  • 斗士狗 2008-09-01 22:50
    关注

    Put an l (lowercased letter L) directly before the specifier.

    unsigned long n;
    long m;
    
    printf("%lu %ld", n, m);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(6条)

报告相同问题?