-
February 24th, 2004, 08:09 PM
#1
#define ?????
Hi there
Can someone tell me What these code mean and why people want to write code like these?
#define LVNI_ALL 0x0000
#define LVNI_FOCUSED 0x0001
#define LVNI_SELECTED 0x0002
#define LVNI_CUT 0x0004
I know that 0x0000, 0x0001, and 0x0002 are Hexadecimal, and those are 0,1,2 in decimal.
Can I change those code to:
#define LVNI_ALL 0
#define LVNI_FOCUSED 1
#define LVNI_SELECTED 2
#define LVNI_CUT 4
Thank for your help
-
February 24th, 2004, 08:13 PM
#2
It is another way of making in alias so that you may use the decriptive text rather than it's numerical equivilant in your code.
-
February 24th, 2004, 08:27 PM
#3
The reason it is in hex is an easy reminder that you are defining unique bits so you can use code like:
if ( a | flag1 || a | flag2 )
Notice that this is a bit wise or not the || operator.
Who was that masked man?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|