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. 回答1: Put an l (lowercased letter L) directly before the specifier. unsigned long n; long m; printf("%lu %ld", n, m); 回答2: I think you mean: unsigned long n; printf("%lu", n); // unsigned long or long n; printf("%ld", n); // signed long 回答3: On most platforms, long and int are the same size (32 bits). Still, it does have its own format specifier: long n; unsigned