hi, i always initialize enum members with integer values. sometime ago, i ran accross some header files of the Qt gui toolkit. instead of integer constants, they use hex constatns.
eg.
Code:
enum Button { Help = 1, Defaults = 2, Ok = 4, Apply = 8, Cancel = 16 };
as opposed to:
Code:
enum SectionFlags {
SectionDefault = 0x00,
SectionSkipEmpty = 0x01,
SectionIncludeLeadingSep = 0x02,
SectionIncludeTrailingSep = 0x04,
SectionCaseInsensitiveSeps = 0x08
my question is: does the fact that integer constants are promoted to (or treated as) double has something to do with this or is it just style? does using hex literal constants make the program more efficient than using integer literal constants?