+ 1

Is it possible to use switch with enum?

I'd like to have user input select the enum value and then evaluate the integer portion of it with switch but am unsure of how.

7th Jul 2019, 2:54 AM
Isaiah Condreay
3 Respostas
+ 1
Directly use user input names of enum u cant its like const variable names. U should do some conversion from string or use integer values. https://code.sololearn.com/cqd9nHVizok7/?ref=app
7th Jul 2019, 11:42 AM
Chicherin Alexey
Chicherin Alexey - avatar
0
of course if your question about Cpp? 😉
7th Jul 2019, 11:43 AM
Chicherin Alexey
Chicherin Alexey - avatar
0
Ya, I'm an intermediate coder with cpp, so that's what I'm familiar with, but I've decided to learn cs
7th Jul 2019, 3:30 PM
Isaiah Condreay