Re: enum count

Discussion in 'C++' started by Steve Pinard, Jul 26, 2003.

  1. Steve Pinard

    Steve Pinard Guest

    Wouldn't that be nice? And wouldn't it be nice to be able to get the
    strings "five", "ten", and "fifteen" too?

    Nothing fancy here:

    enum great
    {
    five,
    ten,
    fifteen,
    LAST // Hey everybody, remember to update this value when you
    change the enum.
    };

    great::LAST == 3

    Of course, like Victor pointed out, this only works for enums where you are
    not assigning specific values.

    --
    Steve Pinard

    "Dr. Spock is the only Star Wars character I know"
    - My Mom




    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 80,000 Newsgroups - 16 Different Servers! =-----
     
    Steve Pinard, Jul 26, 2003
    #1
    1. Advertising

  2. Alexander Terekhov, Jul 26, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. -

    enum within an enum

    -, Jun 12, 2005, in forum: Java
    Replies:
    6
    Views:
    591
  2. Jerminia
    Replies:
    3
    Views:
    659
    Roedy Green
    Oct 7, 2005
  3. Ernst Murnleitner

    How to enum an enum?

    Ernst Murnleitner, Nov 12, 2003, in forum: C++
    Replies:
    5
    Views:
    507
    Rolf Magnus
    Nov 13, 2003
  4. mrhicks
    Replies:
    2
    Views:
    458
    Dave Thompson
    Jun 10, 2004
  5. Randy
    Replies:
    1
    Views:
    533
    David Harmon
    Jan 7, 2006
Loading...

Share This Page