printf ("Some different radixes: %d %x %o %#x %#o \n", 100, 100, 100, 100, 100);
%x shows 100 in hexadecimal basis
64
but %#x makes some memory address out of it
0x64
what does the addition of # ???
This is a discussion on what is the difference between %# and % in printf within the C Programming forums, part of the General Programming Boards category; printf ("Some different radixes: %d %x %o %#x %#o \n", 100, 100, 100, 100, 100); %x shows 100 in hexadecimal ...
printf ("Some different radixes: %d %x %o %#x %#o \n", 100, 100, 100, 100, 100);
%x shows 100 in hexadecimal basis
64
but %#x makes some memory address out of it
0x64
what does the addition of # ???
That's why you go to your friendly terminal screen and type man printf(or google, or the C standard, or heaven forbid, your textbook) and find this:
Originally Posted by ISO C, 7.19.6.1