PMH4514
asked on
Question on #define values
I'm looking at some code, this is purely an example, but I see often things like this:
-------------------------- ---
#define WRITEMODE_TRACKATONCE 0x00
#define WRITEMODE_DISCATONCE 0x01
#define WRITEMODE_DISCATONCE_RAW 0x02
#define WRITEMODE_SESSIONATONCE 0x03
#define WRITEMODE_PACKET_VARIABLE 0x04
#define WRITEMODE_PACKET_FIXED 0x05
#define DISCTYPE_CDR 0
#define DISCTYPE_CDRW 1
#define DISCTYPE_DDCDR 2
#define DISCTYPE_DDCDRW 3
#define DISCTYPE_DVDR 4
-------------------------- ---------- --
that's from a CD write/read library.. My question is, why are constants defined at times like 0x02 and at other times, 2 (for example) What is the fundamental difference and when choosing to go with an 0x type value, from where to do you define the values??
thanks
-paul
--------------------------
#define WRITEMODE_TRACKATONCE 0x00
#define WRITEMODE_DISCATONCE 0x01
#define WRITEMODE_DISCATONCE_RAW 0x02
#define WRITEMODE_SESSIONATONCE 0x03
#define WRITEMODE_PACKET_VARIABLE 0x04
#define WRITEMODE_PACKET_FIXED 0x05
#define DISCTYPE_CDR 0
#define DISCTYPE_CDRW 1
#define DISCTYPE_DDCDR 2
#define DISCTYPE_DDCDRW 3
#define DISCTYPE_DVDR 4
--------------------------
that's from a CD write/read library.. My question is, why are constants defined at times like 0x02 and at other times, 2 (for example) What is the fundamental difference and when choosing to go with an 0x type value, from where to do you define the values??
thanks
-paul
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks!
-Paul