how to read hexadecimal data in C++

Aug 24, 2008 at 11:11pm
So I'm reading this book and so far I think its really good and it gaves you examples and then quizes you with review questions exercises the question is

Using the hexadecimal system, answer this problem

1a + 2e = 48

he even breaks its down but the one thing i cant understand is how he gets 18 then the answer 48

Someone help please heres the braek down

1(1 * 16)+ a(10 * 1)
2(2 * 16)+ e(14 * 1)
--------------------
3(3 * 16)+ 18(24 * 1 = 1 * 16 + 8 * 1) //This is the 18 im talkin about
// It says in the book

Carry the 1 from the low digit to the high digit of the answer, to produce
4(4 * 16)+ 8(8 * 1), or 48 hex,which is the answer.

Well hope someone could break it down better for me to undersatnd it or if you could reccommend some books to better understand Hexadecimal

I posted it hoping you guys could help me and others with a better example or break it down easier to understand it.

Thnx
Aug 24, 2008 at 11:13pm
0xA + 0xE = 0x18
which is equal to:

10 + 14 = 24 in Decimal.
Aug 25, 2008 at 7:04pm
think i got it now thnx

so in Hexdecimal its A + E = 18

In regular decimal its 10 (which signifys A) + 14 (which signifys E) = 24

One more question are there any charts(books) to look it up more easier

Thnx again
Aug 25, 2008 at 7:33pm
Calculator on Windows. Turn on the Scientific option and it can convert between Hex, Oct, Decimal and Binary for you
Topic archived. No new replies allowed.