enum in class

This is a discussion on enum in class within the C++ Programming forums, part of the General Programming Boards category; Is it better including Enum type data in public or private section of the class ? for example when declaring ...

  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    1

    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
    Posts
    2,572
    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 :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

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, 11: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, 02:30 PM
  5. friends class lil prblm with enum
    By rip1968 in forum C++ Programming
    Replies: 4
    Last Post: 07-25-2002, 10:57 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21