enum to string

enum day {monday, tuesday};
Anyone can tell how to transfer monday, tuesday to string "monday", "tuesday"

Thanks
Lookup table:

1
2
3
4
const char* daynames[] = {"monday","tuesday",...};
enum day {monday = 0,tuesday, ... };

cout << daynames[ monday ];
Topic archived. No new replies allowed.