+ 2

What is the enum keyword for in c++ and its usage

24th Jul 2018, 11:34 AM
Johnson Hope Opeoluwa
Johnson Hope Opeoluwa - avatar
2 Answers
+ 3
Thanks that was helpful
24th Jul 2018, 12:38 PM
Johnson Hope Opeoluwa
Johnson Hope Opeoluwa - avatar
+ 2
It's useful for simplify the code. I create an enum with name Days and into {} write the name's of the single day. after use Days like you use an int, char, string... after assign the value to the day. enum Days { Saturday,Sunday,Tuesday,Wednesday,Thursday,Friday}; Days day = Saturday; if(day == Saturday)
24th Jul 2018, 12:33 PM
Yuri Biasi
Yuri Biasi - avatar