behaviour of C# Enum without FlagAttribute - Microsoft Community


i write below code : 

 class program
    {

        enum days { sun = 1, mon = 2, tue = 3, wed =4, thu = 5, fri = 6, sat =7, = 8 };

                     

        static void main()
        {
           console.writeline((days.tue | days.mon).tostring());
           console.writeline((days.sun | days.wed).tostring());

           console.writeline((days.sun | days.sat).tostring());

           console.writeline((days.mon | days.fri).tostring());

         }
}

output 

// tue  --- why not thu ??

// thu

// sat  -- why not extra 

// extra 

why bit operator not  adding number 3,7 (odd numbers)  with enum ? 

hi,

check experts @ these microsoft developer resources.

msdn - developers
http://msdn.microsoft.com/en-us/dn308572.aspx

msdn - developers - community

http://msdn.microsoft.com/developer-communities-msdn


msdn - forums
http://social.msdn.microsoft.com/forums/en/categories/

msdn - forum for…?
http://social.msdn.microsoft.com/forums/en/whatforum/threads


hope helps.
--------------------------------------------------------------------------------------------
rob brown - microsoft mvp <- profile - windows , devices it : bicycle - mark twain said right.



Community Participation Center / Discuss the Microsoft Community site / Getting started on Microsoft Community



Comments

Popular posts from this blog

Windows 10 does not have any of my previous Windows 7 email address. - Microsoft Community