so I think i understand enums, but not quite seeing the use for them in code...
Code:enum TreeType { maple, douglasFir, Alder };
i know that the first enum is 0, unless otherwise defined, and the next enum is the last enum + 1.
however I am kind of struggling understanding the USE for enums.. is there a beneficial difference between me defining each tree type individually versus using an enum? ( sorry for the super simplistic example.. maybe someone could provide a more useful example for enums?)
seems so simple, but I'm just not seeing what i would use enums for in code.. sorry for the nooby question, hopefully you guys can help get me over this feeble bump on the road of programming..Code:int maple = 0; int douglasFir = 1; int Alder = 2;
any help or input would be appreciated, just looking for a different perspective to make this "click" in my head.
cheers



LinkBack URL
About LinkBacks




I did not got it at once bu Laserlight's answer,so thanks for the example!