Article View: comp.std.c++
Article #3651String value of enum
From: W. Dicks
Date: Wed, 13 Mar 1996 07:31
Date: Wed, 13 Mar 1996 07:31
13 lines
1258 bytes
1258 bytes
The system that I'm working often needs to know the string
value of an enum. e.g. enum week{MON=1, ..., SUN} it; it =
TUE;
Then when this enum is passed as a parameter the function
should return the string based on the enum. For instance,
weekImage(it) will return "TUE". Is it not possible that such
a functionality can be built into enums?
---
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]
Technical Details
Message-ID:
<4i5sf3$89c@hermes.is.co.za>Path:
arc1-ca.pugleaf.net!in2.uu.net!bounce-backShow Full Headers
Complete Article Headers
From: "W. Dicks" <wd@isis.co.za> Message-ID: <4i5sf3$89c@hermes.is.co.za> X-Original-Date: 13 Mar 1996 07:11:31 GMT Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back Date: 13 Mar 96 07:31:13 GMT Approved: fjh@cs.mu.oz.au Newsgroups: comp.std.c++ Subject: String value of enum Organization: No organisation supplied X-Mailer: Mozilla 1.22 (Windows; I; 32bit) X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMUZ5z+EDnX0m9pzZAQGZ8gF/awX1a85IRTjqZuBmJDOJdyV5CGtIYFCN 1X1PWFC+NQSh5kkKnC8rjs1N2EZw/Vcw =Ngk6