Hi,
Just wonder is there any way to display enum as enum not as integer?
Thank you.
atch
0
Junior Poster in Training
Recommended Answers
Jump to PostNot without doing some kind of explicit mapping:
#include <iostream> #include <string> enum Color {Red, Blue, Green}; static std::string ToString(Color color) { switch (color) { case Red: return "Red"; case Blue: return "Blue"; case Green: return "Green"; default: return ""; } } int main() { Color color …
All 5 Replies
Tom Gunn
1,164
Practically a Master Poster
atch
0
Junior Poster in Training
wildgoose
420
Practically a Posting Shark
Tom Gunn
1,164
Practically a Master Poster
wildgoose
420
Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.