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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -