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