using hex in gcc

Andrew Haley aph@redhat.com
Thu Jun 7 11:06:00 GMT 2012


On 06/07/2012 07:33 AM, dhruv pant wrote:
> thanks got it...i was actually  thinking in some other way....
> so basically everything is actually stored in binary form.it's for our
> convenience and readability that we are converting them to hex or
> decimal.....
> so suppose...
> unsigned int i=10
> printf("%x",i) //this will print the hex equivalent of 10?

Exactly.  Pocket calculators usually store numbers in decimal,
because for them most of the work is in the I/O.  Computers
usually store numbers in binary: how you print it is up to you.

Andrew.



More information about the Gcc-help mailing list