+ 2
Can anyone please explain about Structures and enumerations in C++ with a bit of examples
Explaining Structures and Enumeration
1 Odpowiedź
+ 3
C++ regular enums are terrible, use enum class instead. Enums are used to represent an exhaustive list of possible values. (see https://www.google.com/url?sa=t&source=web&rct=j&url=https://www.geeksforgeeks.org/enum-classes-in-c-and-their-advantage-over-enum-datatype/amp/&ved=2ahUKEwi37P_5-dXpAhVyUt8KHeSVCj0QFjAsegQIARAB&usg=AOvVaw3OlkXXOMRk3gkkVIVPNmsl&cf=1 for more about enums). C++ structures are a convenient way to bundle values with different data types together.
For example:
https://code.sololearn.com/c47zzhQRoorj/?ref=app