hi everyone, i'm new in c programming. i tried to read sources but stuck with 
enum.
as i know, enum is mainly used to assign names to integral constants. but i 
don't understand, for example, this code
----------------------------------------------
enum term_mode {
    MODE_WRAP        = 1 << 0,
    MODE_INSERT      = 1 << 1,
    MODE_ALTSCREEN   = 1 << 2,
    MODE_CRLF        = 1 << 3,
    MODE_ECHO        = 1 << 4,
    MODE_PRINT       = 1 << 5,
    MODE_UTF8        = 1 << 6,
};
----------------------------------------------why not simply write ?
----------------------------------------------
enum term_mode {
    MODE_WRAP        = 1,
    MODE_INSERT      = 2,
    MODE_ALTSCREEN   = 4,
    MODE_CRLF        = 8,
    MODE_ECHO        = 16,
    MODE_PRINT       = 32,
    MODE_UTF8        = 64,
};
----------------------------------------------

Reply via email to