I came across the following line in a piece of code that uses Microsoft Active Directory:
const AuthenticationTypes ADS_EDMSERVER_BIND = (AuthenticationTypes)0x8000;
What exactly does this line mean ? Particularly, what is the 0x8000
mean ?
I came across the following line in a piece of code that uses Microsoft Active Directory:
const AuthenticationTypes ADS_EDMSERVER_BIND = (AuthenticationTypes)0x8000;
What exactly does this line mean ? Particularly, what is the 0x8000
mean ?
0x8000
is just a hexadecimal representation of integer 32768
. So this line of code essentially defines a constant of enumerable type AuthenticationTypes
with a value of 32768
. The number just specifies some AuthenticationTypes value or may be used as a mask in bit operations (e.g. | or &).
Hexadecimal representations are sometimes used to improve readability or show relations to binary values (there is a nice discussion here). The simplest example is constants that are used in masks or with bit operators.