CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2007
    Posts
    13

    Enumerations inside a class

    Can I use an enumeration inside a class declaration/definition? Should it be pubic or private? I'm talking about defining an enumerated type which will be used as the type for one of the private data members for the class. I thought I remember seeing somewhere that you could do this, but I'm having trouble. I don't want to have to resort to using the enum outside the class and making it global.

    I have a few C++ "do-it-yourself" books and I couldn't find anything about this in them. I even did a google search for "enumeration inside class" and couldn't find anything either. Can anyone help me with this one? Thanks in advance.

  2. #2
    Join Date
    May 2006
    Location
    Norway
    Posts
    1,709

  3. #3
    Join Date
    Dec 2007
    Posts
    13

    Re: Enumerations inside a class

    Thank you. I'm gonna bookmark that site. It looks like it's THE source for C++ programming as far as syntax, structure, form, libraries, that sort of thing. Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured