c language

J

jani.basha991

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.
 
P

Pete Becker

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.
 
V

Victor Bazarov

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,184
Messages
2,570,979
Members
47,579
Latest member
CharaS3188

Latest Threads

Top