By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,035 Members | 1,555 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,035 IT Pros & Developers. It's quick & easy.

c language

P: n/a
what is ment by 0xff and 0xaa. i can't understand these type of codes.
so please any one explain me about these type of codes.
Dec 5 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 2007-12-05 13:07:13 -0500, ja***********@gmail.com said:
what is ment by 0xff and 0xaa. i can't understand these type of codes.
so please any one explain me about these type of codes.
The prefix 0x (as well as 0X) tells the compiler that the characters
that follow are a hexadecimal constant.

--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)

Dec 5 '07 #2

P: n/a
ja***********@gmail.com wrote:
what is ment by 0xff and 0xaa. i can't understand these type of codes.
so please any one explain me about these type of codes.
In C as in C++ (the actual topic of this newsgroup), the syntax 0x
followed by a hexadecimal digit (or digits) denotes a hexadecimal
literal - a number written in the notation base 16. Similarly, if
there is no 'x' after the leading 0, it's an octal literal, and if
the number does not start with 0, it's a decimal literal.

In your case 0xff is 0377 or 255, 0xaa is 0252 or 170.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Dec 5 '07 #3

P: n/a
On Wed, 5 Dec 2007 10:07:13 -0800 (PST) in comp.lang.c++,
ja***********@gmail.com wrote,
>what is ment by 0xff and 0xaa. i can't understand these type of codes.
so please any one explain me about these type of codes.
Please read http://en.wikipedia.org/wiki/Hexadecimal

Dec 5 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.