Thread: enum in class

  1. #1
    Registered User
    Join Date
    Dec 2002

    enum in class

    Is it better including Enum type data in public or private section of the class ? for example when declaring a class for a traffic light ?

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    if the enum is going to be for your classes internal use make it private. If clients of your class must be able to use the enum then make it public.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :-

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Enum type In class.
    By epidemic in forum C++ Programming
    Replies: 2
    Last Post: 03-29-2007, 10:14 AM
  2. Replies: 3
    Last Post: 10-31-2005, 12:05 PM
  3. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 07:18 AM
  4. Abstract class problem
    By VanJay011379 in forum C++ Programming
    Replies: 9
    Last Post: 07-31-2002, 01:30 PM
  5. friends class lil prblm with enum
    By rip1968 in forum C++ Programming
    Replies: 4
    Last Post: 07-25-2002, 09:57 PM