I got an enum
string_e {
FIRST_STRING,
VALUE1,
VALUE2,
LAST_STRING,
}
What I want to do is get
1) int tmp = (int) <string_e-variable>
-> Easy & done
2) string_e tmp = ?????? "VALUE1";
-> So FROM the name as a string TO the enumvalue/int.
3) char*tmp = ????? VALUE1; (result: tmp = "VALUE1")
-> So into the string the NAME of the variable...
Anyone in here does know if that's possible with easy to use functions?
string_e {
FIRST_STRING,
VALUE1,
VALUE2,
LAST_STRING,
}
What I want to do is get
1) int tmp = (int) <string_e-variable>
-> Easy & done
2) string_e tmp = ?????? "VALUE1";
-> So FROM the name as a string TO the enumvalue/int.
3) char*tmp = ????? VALUE1; (result: tmp = "VALUE1")
-> So into the string the NAME of the variable...
Anyone in here does know if that's possible with easy to use functions?