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
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
Put an l
(lowercased letter L) directly before the specifier.
unsigned long n;
long m;
printf("%lu %ld", n, m);