tags:

views:

164

answers:

1

Possible Duplicate:
What is 0x10 in decimal?

I notice that

Console.WriteLine(18);

writes 18, but

Console.WriteLine(0x18);

writes 24. What does this mean?

+10  A: 

The 0x prefix indicates that the following number is in hexadecimal format. i.e. the base 16 number system. So the number 0x18 is (in base 10) (1*16)+(8*1) = 24.

Your example without the prefix 18 is in base 10 already as you would probably expect.

Martin Smith