c++ - Difference between %lli and %lld in printf and scanf? -


my friend , arguing %lli , %lld. use %lli, , every time argues use %lld in printf , scanf. claims %lli , %lld different.

is there difference between %lli , %lld format specifiers in gnu gcc compilers, or same?

for printf, same.

http://en.cppreference.com/w/cpp/io/c/fprintf

d, i converts signed integer decimal representation [-]dddd.

precision specifies minimum number of digits appear. default precision 1. if both converted value , precision ​0​ conversion results in no characters.


for scanf, different. below quote documentation.

d matches decimal integer. format of number same expected strtol() value 10 base argument

i matches integer. format of number same expected strtol() value ​0​ base argument (base determined first characters parsed)

in case of i, if number starts 0, parsed octal.

http://en.cppreference.com/w/cpp/io/c/fscanf


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -