"group"

This is a discussion on "group" within the C++ Programming forums, part of the General Programming Boards category; I have a class called member. which has some get&set functions for email and name etc. but i also want ...

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    86

    "group"

    I have a class called member. which has some get&set functions for email and name etc.
    but i also want to make some kind of "GROUP" data member, in this case the member either is a normal member, a VIP or an ADMIN. if u get my point... but how do i achieve this? i wouldnt want to go with just strings i was thinking of using some kind of struct? or... i cant realy find a good idea.

    I am also going to save the class in binary, so i think a struct would work

  2. #2
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,471
    I'd use enum
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    86
    how do i use this type enum?

  4. #4
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,471
    Code:
    enum Group {Normal, Admin, VIP};
    Maybe?
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  5. #5
    Registered User
    Join Date
    Nov 2006
    Posts
    86
    might u know a full tutorial on ENUM? so i know everything

  6. #6
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,471
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

Popular pages Recent additions subscribe to a feed

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