I am trying to solve an assignment and I searched in every possible way for an answer, but managed to only get "how to transform an enum into a string"
I have a string called type
that can only contain "webApp", "MobileApp" and "DesktopApp". I have an enum that looks like this:
enum applicationType { webApp = 5, MobileApp = 10, DesktopApp = 15 };
How can I print the value from the enum corresponding to the string using a function?
applicationType print_enum(string tip) {
//if tip contains "webApp" i should print 5
}
How do I make the function test if the value of the string corresponds to a value in the enum, and if it does print that value?