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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
0xprefix indicates that the following number is in hexadecimal format. i.e. the base 16 number system. So the number0x18is (in base 10) (1 * 16^1) + (8 * 16^0) = 24 (remember: 16^0 = 1).Your example without the prefix
18is in base 10 already as you would probably expect.