What is the argument for printf that formats a long?

前端 未结 7 2237
醉酒成梦
醉酒成梦 2020-11-28 17:50

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

7条回答
  •  误落风尘
    2020-11-28 18:14

    In case you're looking to print unsigned long long as I was, use:

    unsigned long long n;
    printf("%llu", n);
    

    For all other combinations, I believe you use the table from the printf manual, taking the row, then column label for whatever type you're trying to print (as I do with printf("%llu", n) above).

提交回复
热议问题