T
tony collier
if i have a string eg
string day="monday";
and an enumerator
enum days {monday=0,tuesday, wednesday}
how can i use the enumerator so that instead of writing
days.monday
to return 0
i can use the value of the string day as the enum literal eg. something
like:
days."value of day"
so that if day="monday" this equals 0, if day="tuesday" this equals 1 and
if day="wednesday" this returns 2
string day="monday";
and an enumerator
enum days {monday=0,tuesday, wednesday}
how can i use the enumerator so that instead of writing
days.monday
to return 0
i can use the value of the string day as the enum literal eg. something
like:
days."value of day"
so that if day="monday" this equals 0, if day="tuesday" this equals 1 and
if day="wednesday" this returns 2