Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > LPCSTR-based enum -- possible?

Reply
Thread Tools

LPCSTR-based enum -- possible?

 
 
vb739
Guest
Posts: n/a
 
      04-12-2007
Can something like this be done:

enum ABC
{
A = "A",
B = "B",
C = "C"
};

, that is can a const string address be used as an enum value?

Thanks,
V.

 
Reply With Quote
 
 
 
 
Greg Comeau
Guest
Posts: n/a
 
      04-12-2007
In article < om>,
vb739 <> wrote:
>Can something like this be done:
>
>enum ABC
>{
> A = "A",
> B = "B",
> C = "C"
>};
>
>, that is can a const string address be used as an enum value?


No. But you'll probably want to have a look here:

http://www.comeaucomputing.com/techtalk/#enumtostring

Sit down first.
--
Greg Comeau / 4.3.9 with C++0xisms now in beta!
Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout
World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ENUM server for private ENUM kael UK VOIP 2 02-25-2007 11:54 AM
enum: display elements of an enum specified at runtime Jerminia Java 3 10-07-2005 10:08 PM
enum within an enum - Java 6 06-13-2005 12:51 AM
Including an enum within another enum, possible? mrhicks C Programming 2 06-10-2004 03:00 AM
How to enum an enum? Ernst Murnleitner C++ 5 11-13-2003 11:06 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57