private variables

This is a discussion on private variables within the C++ Programming forums, part of the General Programming Boards category; what is the meaning of PRIVATE members i think one of their purpose is to protect us from wrongly changing ...

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    65

    private variables

    what is the meaning of PRIVATE members
    i think one of their purpose is to protect us from wrongly changing them, am i right?

  2. #2
    3735928559
    Join Date
    Mar 2008
    Location
    RTP
    Posts
    839
    they're members that aren't accessible outside the class. yes, the primary purpose is to prevent someone from mucking up members that are critical to using the object; another is to keep the interface relevant, clean, and uncluttered.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Private variables lose value between functions
    By SkylerZio in forum C++ Programming
    Replies: 6
    Last Post: 05-15-2010, 11:43 PM
  2. private variables, functions help
    By StealthRT in forum C++ Programming
    Replies: 6
    Last Post: 09-10-2009, 08:56 AM
  3. Protected / Private Variables accessable.
    By +Azazel+ in forum C++ Programming
    Replies: 19
    Last Post: 09-08-2009, 07:39 PM
  4. about private class variables
    By bulletbutter in forum C++ Programming
    Replies: 5
    Last Post: 04-18-2008, 12:13 PM
  5. Public vs. Private variables in classes
    By blankstare77 in forum C++ Programming
    Replies: 13
    Last Post: 08-31-2005, 05:43 PM

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