Difference between %lli and %lld in printf and scanf?
我和我的朋友在争论
GNU GCC编译器中的
对于printf,它们完全相同。
http://en.cppreference.com/w/cpp/io/c/fprintf
d ,i converts a signed integer into decimal representation [-]dddd.Precision specifies the minimum number of digits to appear. The default precision is 1.
If both the converted value and the precision are ?0? the conversion results in no characters.
对于scanf,它们是不同的。 以下是来自文档的引用。
d matches a decimal integer.
The format of the number is the same as expected by strtol() with the value 10 for the base argument
i matches an integer.
The format of the number is the same as expected by strtol() with the value ?0? for the base argument (base is determined by the first characters parsed)
对于
http://en.cppreference.com/w/cpp/io/c/fscanf
可能您应该看到文档...?
对于
http://www.cplusplus.com/reference/cstdio/scanf/
对于说明符
对于
默认情况下假设使用十进制数字(0-9),但是0前缀将引入八进制数字(0-7)和0x十六进制数字(0-f)。
签名的论点。