"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
    "I Win!" by U. Lose vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,532
    I'd use enum
    To be or not to be == true

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

  4. #4
    "I Win!" by U. Lose vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,532
    Code:
    enum Group {Normal, Admin, VIP};
    Maybe?
    To be or not to be == true

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

  6. #6
    "I Win!" by U. Lose vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,532
    To be or not to be == true

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